mlr_pipeops_torch_optimizer | R Documentation |
Configures the optimizer of a deep learning model.
The parameters are defined dynamically from the optimizer that is set during construction.
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
.
The state is the value calculated by the public method shapes_out()
.
During training, the optimizer is cloned and added to the ModelDescriptor
.
Note that the parameter set of the stored TorchOptimizer
is reference-identical to the parameter set of the
pipeop itself.
mlr3pipelines::PipeOp
-> PipeOpTorchOptimizer
new()
Creates a new instance of this R6 class.
PipeOpTorchOptimizer$new( optimizer = t_opt("adam"), id = "torch_optimizer", param_vals = list() )
optimizer
(TorchOptimizer
or character(1)
or torch_optimizer_generator
)
The optimizer (or something convertible via as_torch_optimizer()
).
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.
clone()
The objects of this class are cloneable with this method.
PipeOpTorchOptimizer$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other PipeOp:
mlr_pipeops_module
,
mlr_pipeops_torch_callbacks
Other Model Configuration:
ModelDescriptor()
,
mlr_pipeops_torch_callbacks
,
mlr_pipeops_torch_loss
,
model_descriptor_union()
po_opt = po("torch_optimizer", "sgd", lr = 0.01)
po_opt$param_set
mdin = po("torch_ingress_num")$train(list(tsk("iris")))
mdin[[1L]]$optimizer
mdout = po_opt$train(mdin)
mdout[[1L]]$optimizer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.