Skip to content

Commit be78470

Browse files
committed
update model defaults
1 parent b9e8c96 commit be78470

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

bayesflow/networks/diffusion_model/diffusion_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class DiffusionModel(InferenceNetwork):
4040
"activation": "mish",
4141
"kernel_initializer": "he_normal",
4242
"residual": True,
43-
"dropout": 0.0,
43+
"dropout": 0.05,
4444
"spectral_normalization": False,
4545
}
4646

4747
INTEGRATE_DEFAULT_CONFIG = {
48-
"method": "rk45",
49-
"steps": 100,
48+
"method": "two_step_adaptive",
49+
"steps": "adaptive",
5050
}
5151

5252
def __init__(

bayesflow/networks/flow_matching/flow_matching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class FlowMatching(InferenceNetwork):
5353
}
5454

5555
INTEGRATE_DEFAULT_CONFIG = {
56-
"method": "rk45",
57-
"steps": 100,
56+
"method": "tsit5",
57+
"steps": "adaptive",
5858
}
5959

6060
def __init__(

bayesflow/utils/integrate.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def rk45_step(
6565
use_adaptive_step_size: bool = True,
6666
) -> Tuple[StateDict, ArrayLike, StateDict | None, ArrayLike]:
6767
"""
68-
Dormand-Prince 5(4) method with embedded error estimation.
68+
Dormand-Prince 5(4) method with embedded error estimation [1].
69+
70+
Dormand (1996), Numerical Methods for Differential Equations: A Computational Approach
6971
"""
7072
h = step_size
7173

@@ -124,7 +126,9 @@ def tsit5_step(
124126
use_adaptive_step_size: bool = True,
125127
) -> Tuple[StateDict, ArrayLike, StateDict | None, ArrayLike]:
126128
"""
127-
Implements a single step of the Tsitouras 5/4 Runge-Kutta method.
129+
Implements a single step of the Tsitouras 5/4 Runge-Kutta method [1].
130+
131+
[1] Tsitouras (2011), Runge--Kutta pairs of order 5(4) satisfying only the first column simplifying assumption
128132
"""
129133
h = step_size
130134

0 commit comments

Comments
 (0)