Skip to content

Commit 187140a

Browse files
committed
Small fixes to spline documentation [skip ci]
1 parent 8ac051b commit 187140a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bayesflow/coupling_networks.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# SOFTWARE.
2020

2121
import tensorflow as tf
22+
from numpy import e as EULER_CONST
2223
from numpy import pi as PI_CONST
2324

2425
from bayesflow import default_settings
@@ -52,13 +53,13 @@ def __init__(self, dim_out, settings_dict, **kwargs):
5253
settings_dict : dict
5354
The settings for the inner networks. Defaults will use:
5455
``settings_dict={
55-
"dense_args" : dict(units=128, kernel_initializer="glorot_uniform", activation="tanh"),
56+
"dense_args" : dict(units=128, activation="relu"),
5657
"num_dense" : 2,
5758
"spec_norm" : False,
5859
"mc_dropout" : False,
5960
"dropout" : True,
6061
"residual" : False,
61-
"dropout_prob" : 0.05,
62+
"dropout_prob" : 0.01,
6263
"soft_clamping" : 1.9
6364
}
6465
``
@@ -192,15 +193,15 @@ def __init__(self, dim_out, settings_dict, **kwargs):
192193
settings_dict : dict
193194
The settings for the inner networks. Defaults will use:
194195
``settings_dict={
195-
"dense_args" : dict(units=128, activation="tanh"),
196+
"dense_args" : dict(units=128, activation="relu"),
196197
"num_dense" : 2,
197198
"spec_norm" : False,
198199
"mc_dropout" : False,
199200
"dropout" : True,
200201
"residual" : False,
201202
"dropout_prob" : 0.05,
202-
"bins" : 10,
203-
"default_domain" : (-10., 10., -10., 10.)
203+
"bins" : 16,
204+
"default_domain" : (-5., 5., -5., 5.)
204205
}
205206
``
206207
"""
@@ -479,7 +480,7 @@ def _constrain_parameters(self, parameters):
479480
heights = tf.math.softplus(heights + yshift)
480481

481482
# Compute spline derivatives
482-
shift = tf.math.log(tf.math.exp(1.0) - 1.0)
483+
shift = tf.math.log(EULER_CONST - 1.0)
483484
derivatives = tf.nn.softplus(derivatives + shift)
484485

485486
# Add in edge derivatives

0 commit comments

Comments
 (0)