|
19 | 19 | # SOFTWARE. |
20 | 20 |
|
21 | 21 | import tensorflow as tf |
| 22 | +from numpy import e as EULER_CONST |
22 | 23 | from numpy import pi as PI_CONST |
23 | 24 |
|
24 | 25 | from bayesflow import default_settings |
@@ -52,13 +53,13 @@ def __init__(self, dim_out, settings_dict, **kwargs): |
52 | 53 | settings_dict : dict |
53 | 54 | The settings for the inner networks. Defaults will use: |
54 | 55 | ``settings_dict={ |
55 | | - "dense_args" : dict(units=128, kernel_initializer="glorot_uniform", activation="tanh"), |
| 56 | + "dense_args" : dict(units=128, activation="relu"), |
56 | 57 | "num_dense" : 2, |
57 | 58 | "spec_norm" : False, |
58 | 59 | "mc_dropout" : False, |
59 | 60 | "dropout" : True, |
60 | 61 | "residual" : False, |
61 | | - "dropout_prob" : 0.05, |
| 62 | + "dropout_prob" : 0.01, |
62 | 63 | "soft_clamping" : 1.9 |
63 | 64 | } |
64 | 65 | `` |
@@ -192,15 +193,15 @@ def __init__(self, dim_out, settings_dict, **kwargs): |
192 | 193 | settings_dict : dict |
193 | 194 | The settings for the inner networks. Defaults will use: |
194 | 195 | ``settings_dict={ |
195 | | - "dense_args" : dict(units=128, activation="tanh"), |
| 196 | + "dense_args" : dict(units=128, activation="relu"), |
196 | 197 | "num_dense" : 2, |
197 | 198 | "spec_norm" : False, |
198 | 199 | "mc_dropout" : False, |
199 | 200 | "dropout" : True, |
200 | 201 | "residual" : False, |
201 | 202 | "dropout_prob" : 0.05, |
202 | | - "bins" : 10, |
203 | | - "default_domain" : (-10., 10., -10., 10.) |
| 203 | + "bins" : 16, |
| 204 | + "default_domain" : (-5., 5., -5., 5.) |
204 | 205 | } |
205 | 206 | `` |
206 | 207 | """ |
@@ -479,7 +480,7 @@ def _constrain_parameters(self, parameters): |
479 | 480 | heights = tf.math.softplus(heights + yshift) |
480 | 481 |
|
481 | 482 | # Compute spline derivatives |
482 | | - shift = tf.math.log(tf.math.exp(1.0) - 1.0) |
| 483 | + shift = tf.math.log(EULER_CONST - 1.0) |
483 | 484 | derivatives = tf.nn.softplus(derivatives + shift) |
484 | 485 |
|
485 | 486 | # Add in edge derivatives |
|
0 commit comments