Checking documentation for current stable Flux v0.13.16, I am wondering why it is suggested so many transformations (struct, functor) prior to saving a model with Flux.state(transformed_model).
In which sense just saving Flux.state(model) is not preferred?
Preferred saving method follows here for reference:
julia> using Flux julia> struct MyModel net end julia> Flux.@functor MyModel julia> MyModel() = MyModel(Chain(Dense(10, 5, relu), Dense(5, 2))); julia> model = MyModel() MyModel(Chain(Dense(10 => 5, relu), Dense(5 => 2))) julia> model_state = Flux.state(model); julia> using JLD2 julia> jldsave("mymodel.jld2"; model_state)