Skip to content

Commit 1199e3e

Browse files
committed
update usage
1 parent 39cc093 commit 1199e3e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎examples/usage.jl‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ r = convert.(Float32, r)
1515

1616
# Parameters
1717
nvars = size(r, 1)
18-
naugs = nvars
18+
naugs = nvars + 1
1919
n_in = nvars + naugs
2020

2121
# Model
@@ -27,15 +27,15 @@ using ContinuousNormalizingFlows,
2727

2828
nn = Chain(Dense(n_in => 3 * n_in, tanh), Dense(3 * n_in => n_in, tanh))
2929
icnf = construct(
30-
RNODE,
30+
ICNF,
3131
nn,
3232
nvars, # number of variables
3333
naugs; # number of augmented dimensions
3434
compute_mode = LuxVecJacMatrixMode(AutoZygote()), # process data in batches and use Zygote
3535
inplace = false, # not using the inplace version of functions
3636
device = cpu_device(), # process data by CPU
3737
# device = gpu_device(), # process data by GPU
38-
tspan = (0.0f0, 10.0f0), # have bigger time span
38+
tspan = (0.0f0, 1.0f0), # time span
3939
steer_rate = 1.0f-1, # add random noise to end of the time span
4040
λ₁ = 1.0f-2, # regulate flow
4141
λ₂ = 1.0f-2, # regulate volume change
@@ -52,10 +52,10 @@ using DataFrames, MLJBase, Zygote, ADTypes, OptimizationOptimisers
5252
df = DataFrame(transpose(r), :auto)
5353
model = ICNFModel(
5454
icnf;
55-
optimizers = (Adam(),),
55+
optimizers = (Lion(),),
5656
adtype = AutoZygote(),
5757
batchsize = 512,
58-
sol_kwargs = (; epochs = 300), # pass to the solver
58+
sol_kwargs = (; epochs = 300, progress = true), # pass to the solver
5959
)
6060
mach = machine(model, df)
6161
fit!(mach)

0 commit comments

Comments
 (0)