When running an optimization with Adam() and the extended trace enabled, the code fails. See the following MWE:
using Optim
f(x) = (x[1]-1)^2
# runs without error
Optim.optimize(f, [0.0], Adam(), Optim.Options(extended_trace=false))
# fails with "type AdamState has no field alpha"
Optim.optimize(f, [0.0], Adam(), Optim.Options(extended_trace=true))
The problem is that common_trace! tries to access state.alpha, which is not a property of AdamState.
When running an optimization with
Adam()
and the extended trace enabled, the code fails. See the following MWE:The problem is that
common_trace!
tries to accessstate.alpha
, which is not a property ofAdamState
.Tested on Optim v1.9.4 and julia v1.10.3.