Closed alec-hoyland closed 8 months ago
stateaccess
refers to Callbacks not Metrics, so it should be
function FluxTraining.stateaccess(::FluxTraining.Metrics)
return (
model = (weight = FluxTraining.Read(),),
params = FluxTraining.Read(),
cbstate = (metricsstep = FluxTraining.Write(), metricsepoch = FluxTraining.Write(), history = FluxTraining.Read()),
step = FluxTraining.Read(),
)
end
Expected Behavior
I can override default state access restrictions using the
stateaccess
function to readlearner.model.weight
within the context ofFluxTraining.step!(metric::MyMetric)
to do some computation during the validation phase.What I want to do is write a custom metric that has access to
learner.model.weight
, e.g. something like:Error
I can't get this to work and I am unsure if it is a mistake on my end or if this is a bug.
Package info
System info
Pop! OS 22.04 LTS x86_64 with Julia version 1.9.0
Stacktrace
Minimum Working Example