There is one input channel "input" that takes in ModelDescriptor during traing and a Task of the specified task_type during prediction. The output is NULL during training and a Prediction of given task_type during prediction.
State
A trained LearnerTorchModel.
Internals
A LearnerTorchModel is created by calling model_descriptor_to_learner() on the provided ModelDescriptor that is received through the input channel. Then the parameters are set according to the parameters specified in PipeOpTorchModel and its '$train()method is called on the [Task][mlr3::Task] stored in the [ModelDescriptor`].
Examples
# simple linear regression# build the model descriptormd = as_graph(po("torch_ingress_num")%>>% po("nn_head")%>>% po("torch_loss","mse")%>>% po("torch_optimizer","adam"))$train(tsk("mtcars"))[[1L]]print(md)# build the learner from the model descriptor and train itpo_model = po("torch_model_regr", batch_size =20, epochs =1)po_model$train(list(md))po_model$state