Optimisers.jl
Optimisers.jl copied to clipboard
Optimizing scalars
It seems like Optimisers only works with vectors.
struct WithFloat
val :: Float64
end
@functor WithFloat
The call to Optimisers.trainable(WithFloat(4)) returns (val = 4.3,), but destructure(WithFloat(4)) produces an empty vector.
Would you accept a pull request allowing destructure to handle scalar parameters?
It's not so straightforward, unfortunately. See https://github.com/FluxML/Flux.jl/issues/1991#issuecomment-1148627732 and https://github.com/FluxML/Optimisers.jl/pull/33.