Skip to content

Commit

Permalink
add sol_kwargs to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
prbzrg committed Oct 16, 2024
1 parent dc15bc4 commit 528ab49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ icnf = construct(
λ₁ = 1.0f-2, # regulate flow
λ₂ = 1.0f-2, # regulate volume change
λ₃ = 1.0f-2, # regulate augmented dimensions
sol_kwargs = (;
progress = true,
save_everystep = false,
reltol = sqrt(eps(one(Float32))),
abstol = eps(one(Float32)),
maxiters = typemax(Int32),
), # pass to the solver
)

# Data
Expand All @@ -76,6 +83,9 @@ model = ICNFModel(
# adtype = AutoZygote(),
# use_batch = true,
# batch_size = 32,
sol_kwargs = (;
progress = true,
), # pass to the solver
)
mach = machine(model, df)
fit!(mach)
Expand Down
12 changes: 1 addition & 11 deletions src/base_icnf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@ function construct(
FillArrays.Zeros{data_type}(nvars + naugmented),
FillArrays.Eye{data_type}(nvars + naugmented),
),
suggested_sol_kwargs::Bool = false,
sol_kwargs::NamedTuple = if suggested_sol_kwargs
(;
save_everystep = false,
reltol = sqrt(eps(one(Float32))),
abstol = eps(one(Float32)),
maxiters = typemax(Int32),
)
else
(;)
end,
sol_kwargs::NamedTuple = (;),
rng::Random.AbstractRNG = rng_AT(resource),
λ₁::AbstractFloat = if aicnf <: Union{RNODE, CondRNODE}
convert(data_type, 1.0e-2)
Expand Down

0 comments on commit 528ab49

Please sign in to comment.