Creates an R6ClassGenerator inheriting from CallbackSet. Additionally performs checks such as that the stages are not accidentally misspelled. To create a TorchCallback use torch_callback().
In order for the resulting class to be cloneable, the private method $deep_clone() must be provided.
Function to execute at the given stage, see section Stages.
state_dict: (function())
The function that retrieves the state dict from the callback. This is what will be available in the learner after training.
load_state_dict: (function(state_dict))
Function that loads a callback state.
initialize: (function())
The initialization method of the callback.
public, private, active: (list())
Additional public, private, and active fields to add to the callback.
parent_env: (environment())
The parent environment for the R6Class.
inherit: (R6ClassGenerator)
From which class to inherit. This class must either be CallbackSet (default) or inherit from it.
lock_objects: (logical(1))
Whether to lock the objects of the resulting R6Class. If FALSE (default), values can be freely assigned to self without declaring them in the class definition.