mlr_pipeops_torch_callbacks {mlr3torch}R Documentation

Callback Configuration

Description

Configures the callbacks of a deep learning model.

Input and Output Channels

There is one input channel "input" and one output channel "output". During training, the channels are of class ModelDescriptor. During prediction, the channels are of class Task.

State

The state is the value calculated by the public method shapes_out().

Parameters

The parameters are defined dynamically from the callbacks, where the id of the respective callbacks is the respective set id.

Internals

During training the callbacks are cloned and added to the ModelDescriptor.

Super class

mlr3pipelines::PipeOp -> PipeOpTorchCallbacks

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
PipeOpTorchCallbacks$new(
  callbacks = list(),
  id = "torch_callbacks",
  param_vals = list()
)
Arguments
callbacks

(list of TorchCallbacks)
The callbacks (or something convertible via as_torch_callbacks()). Must have unique ids. All callbacks are cloned during construction.

id

(character(1))
Identifier of the resulting object.

param_vals

(list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction.


Method clone()

The objects of this class are cloneable with this method.

Usage
PipeOpTorchCallbacks$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other Model Configuration: ModelDescriptor(), mlr_pipeops_torch_loss, mlr_pipeops_torch_optimizer, model_descriptor_union()

Other PipeOp: mlr_pipeops_module, mlr_pipeops_torch_optimizer

Examples


po_cb = po("torch_callbacks", "checkpoint")
po_cb$param_set
mdin = po("torch_ingress_num")$train(list(tsk("iris")))
mdin[[1L]]$callbacks
mdout = po_cb$train(mdin)[[1L]]
mdout$callbacks
# Can be called again
po_cb1 = po("torch_callbacks", t_clbk("progress"))
mdout1 = po_cb1$train(list(mdout))[[1L]]
mdout1$callbacks


[Package mlr3torch version 0.1.0 Index]