### Other

private stateaccessfunction

stateaccess(callback)


Return a named tuple determining what learner state callback can access.

The default is (;), the empty named tuple, meaning no state can be accessed.

Implementations of stateaccess should always return the least permissions possible.

For example, the ToGPU callback needs to write both the model and the batch data, so its stateaccess implementation is:

stateaccess(::ToGPU) = (
model = Write(),
params = Write(),
batch = (xs = Write(), ys = Write()),
)


Be careful when defining stateaccess that you do return a NamedTuple. (x = Read(),) is one but (x = Read()) (without the comma) is parsed as an assignment with value Read().

stateaccess(::Type{HyperParameter})


Defines what Learner state is accessed when calling sethyperparameter! and gethyperparameter. This is needed so that Scheduler can access the state.