3131 regularize = false
3232 monte_carlo = false
3333
34- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
34+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
3535 end
3636 @testset " regularize=false & monte_carlo=true" begin
3737 regularize = false
3838 monte_carlo = true
3939
40- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
40+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
4141 end
4242 @testset " regularize=true & monte_carlo=false" begin
4343 regularize = true
4444 monte_carlo = false
4545
46- @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
46+ @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
4747 end
4848 @testset " regularize=true & monte_carlo=true" begin
4949 regularize = true
5050 monte_carlo = true
5151
52- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
52+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
5353 end
5454 end
5555 @testset " AutoReverseDiff as adtype" begin
5858 @testset " regularize=false & monte_carlo=false" begin
5959 regularize = false
6060 monte_carlo = false
61-
62- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
61+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
6362 end
6463 @testset " regularize=false & monte_carlo=true" begin
6564 regularize = false
6665 monte_carlo = true
67-
68- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
66+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
6967 end
7068 @testset " regularize=true & monte_carlo=false" begin
7169 regularize = true
7270 monte_carlo = false
7371
74- @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
72+ @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
7573 end
7674 @testset " regularize=true & monte_carlo=true" begin
7775 regularize = true
7876 monte_carlo = true
79-
80- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
77+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
8178 end
8279 end
8380 @testset " AutoTracker as adtype" begin
8683 @testset " regularize=false & monte_carlo=false" begin
8784 regularize = false
8885 monte_carlo = false
89-
90- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
86+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
9187 end
9288 @testset " regularize=false & monte_carlo=true" begin
9389 regularize = false
9490 monte_carlo = true
95-
96- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
91+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
9792 end
9893 @testset " regularize=true & monte_carlo=false" begin
9994 regularize = true
10095 monte_carlo = false
10196
102- @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
97+ @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
10398 end
10499 @testset " regularize=true & monte_carlo=true" begin
105100 regularize = true
106101 monte_carlo = true
107-
108- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0.1 ), adtype; callback = callback, maxiters= 10 ))
102+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f-1 ), adtype; callback = callback, maxiters= 10 ))
109103 end
110104 end
111105 @testset " AutoZygote as adtype" begin
@@ -115,25 +109,25 @@ end
115109 regularize = false
116110 monte_carlo = false
117111
118- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
112+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
119113 end
120114 @testset " regularize=false & monte_carlo=true" begin
121115 regularize = false
122116 monte_carlo = true
123117
124- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
118+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
125119 end
126120 @testset " regularize=true & monte_carlo=false" begin
127121 regularize = true
128122 monte_carlo = false
129123
130- @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
124+ @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
131125 end
132126 @testset " regularize=true & monte_carlo=true" begin
133127 regularize = true
134128 monte_carlo = true
135129
136- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
130+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
137131 end
138132 end
139133 @testset " AutoFiniteDiff as adtype" begin
@@ -143,25 +137,25 @@ end
143137 regularize = false
144138 monte_carlo = false
145139
146- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
140+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
147141 end
148142 @testset " regularize=false & monte_carlo=true" begin
149143 regularize = false
150144 monte_carlo = true
151145
152- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
146+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
153147 end
154148 @testset " regularize=true & monte_carlo=false" begin
155149 regularize = true
156150 monte_carlo = false
157151
158- @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
152+ @test_broken ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
159153 end
160154 @testset " regularize=true & monte_carlo=true" begin
161155 regularize = true
162156 monte_carlo = true
163157
164- @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 10 ))
158+ @test ! isnothing (DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 10 ))
165159 end
166160 end
167161end
185179 regularize = false
186180 monte_carlo = false
187181
188- res = DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (0. 1 ), adtype; callback= callback, maxiters= 10 )
182+ res = DiffEqFlux. sciml_train (θ -> loss (θ; regularize, monte_carlo), ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback= callback, maxiters= 10 )
189183 ffjord_d = FFJORDDistribution (FFJORD (nn, tspan, Tsit5 (); p= res. u); regularize, monte_carlo)
190184
191185 @test ! isnothing (pdf (ffjord_d, train_data))
211205 end
212206
213207 adtype = Optimization. AutoZygote ()
214- res = DiffEqFlux. sciml_train (loss, ffjord_mdl. p, ADAM (0. 1 ), adtype; callback= callback, maxiters= 100 )
208+ res = DiffEqFlux. sciml_train (loss, ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback= callback, maxiters= 100 )
215209
216210 actual_pdf = pdf .(data_dist, test_data)
217211 learned_pdf = exp .(ffjord_mdl (test_data, res. u; regularize, monte_carlo)[1 ])
239233 end
240234
241235 adtype = Optimization. AutoZygote ()
242- res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 100 )
236+ res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 100 )
243237
244238 actual_pdf = pdf .(data_dist, test_data)
245239 learned_pdf = exp .(ffjord_mdl (test_data, res. u; regularize, monte_carlo)[1 ])
268262 end
269263
270264 adtype = Optimization. AutoZygote ()
271- res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 300 )
265+ res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 300 )
272266
273267 actual_pdf = pdf (data_dist, test_data)
274268 learned_pdf = exp .(ffjord_mdl (test_data, res. u; regularize, monte_carlo)[1 ])
@@ -293,11 +287,11 @@ end
293287
294288 function loss (θ)
295289 logpx, λ₁, λ₂ = ffjord_mdl (train_data, θ; regularize, monte_carlo)
296- mean (- logpx .+ 0. 1 * λ₁ .+ 0. 1 * λ₂)
290+ mean (- logpx .+ 1f- 1 * λ₁ .+ 1f- 1 * λ₂)
297291 end
298292
299293 adtype = Optimization. AutoZygote ()
300- res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (0. 1 ), adtype; callback = callback, maxiters= 300 )
294+ res = DiffEqFlux. sciml_train (loss, 0.01f0 * ffjord_mdl. p, ADAM (1f- 1 ), adtype; callback = callback, maxiters= 300 )
301295
302296 actual_pdf = pdf (data_dist, test_data)
303297 learned_pdf = exp .(ffjord_mdl (test_data, res. u; regularize, monte_carlo)[1 ])
0 commit comments