Skip to content

Commit 060fd66

Browse files
committed
use QuadratureAdjoint
1 parent ad562ef commit 060fd66

4 files changed

Lines changed: 14 additions & 16 deletions

File tree

examples/usage.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ icnf = ICNF(;
5656
reltol = 1.0e-4,
5757
abstol = 1.0e-8,
5858
alg = VCABM(; thread = Threaded()),
59-
sensealg = GaussAdjoint(;
60-
checkpointing = true,
59+
sensealg = QuadratureAdjoint(;
6160
autodiff = true,
6261
autojacvec = ZygoteVJP(),
62+
reltol = 1.0e-4,
63+
abstol = 1.0e-8,
6364
),
6465
progress = false,
6566
verbose = Detailed(),
@@ -84,7 +85,7 @@ if !isfile(icnf_mach_fn)
8485
optimizers = (
8586
OptimiserChain(
8687
WeightDecay(; lambda = 1.0e-4),
87-
ClipNorm(1.0, 2.0; throw = true),
88+
ClipNorm(10.0, 2.0; throw = true),
8889
Adam(; eta = 0.001, beta = (0.9, 0.999), epsilon = 1.0e-8),
8990
),
9091
),

src/core/icnf.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,15 @@ function ICNF(;
8989
alg = OrdinaryDiffEqAdamsBashforthMoulton.VCABM(;
9090
thread = FastBroadcast.Threaded(),
9191
),
92-
sensealg = ifelse(
93-
(!inplace && compute_mode isa LuxMatrixMode),
94-
SciMLSensitivity.GaussAdjoint(;
95-
checkpointing = true,
96-
autodiff = true,
97-
autojacvec = SciMLSensitivity.ZygoteVJP(),
98-
),
99-
SciMLSensitivity.InterpolatingAdjoint(;
100-
checkpointing = true,
101-
autodiff = true,
102-
autojacvec = true,
92+
sensealg = SciMLSensitivity.QuadratureAdjoint(;
93+
autodiff = true,
94+
autojacvec = ifelse(
95+
(!inplace && compute_mode isa LuxMatrixMode),
96+
SciMLSensitivity.ZygoteVJP(),
97+
true,
10398
),
99+
reltol = convert(data_type, 1.0e-4),
100+
abstol = convert(data_type, 1.0e-8),
104101
),
105102
progress = false,
106103
verbose = SciMLLogging.Detailed(),

src/exts/mlj_ext/core_cond_icnf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function CondICNFModel(;
1414
Optimisers.OptimiserChain(
1515
Optimisers.WeightDecay(; lambda = convert(eltype(icnf), 1.0e-4)),
1616
Optimisers.ClipNorm(
17-
one(eltype(icnf)),
17+
convert(eltype(icnf), 10.0),
1818
convert(eltype(icnf), 2.0);
1919
throw = true,
2020
),

src/exts/mlj_ext/core_icnf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function ICNFModel(;
1414
Optimisers.OptimiserChain(
1515
Optimisers.WeightDecay(; lambda = convert(eltype(icnf), 1.0e-4)),
1616
Optimisers.ClipNorm(
17-
one(eltype(icnf)),
17+
convert(eltype(icnf), 10.0),
1818
convert(eltype(icnf), 2.0);
1919
throw = true,
2020
),

0 commit comments

Comments
 (0)