Skip to contents

The GraphLearner that as_learner_torch() returns. On top of a GraphLearner it has the $network, $loss, $optimizer and $callbacks fields and the $dataset() method of a LearnerTorch. It is not in the mlr_learners dictionary, because it cannot be constructed without a graph.

Super classes

mlr3::Learner -> mlr3pipelines::GraphLearner -> GraphLearnerTorch

Active bindings

network

(nn_module)
The network of the trained learner, i.e. $base_learner()$network.

loss

(TorchLoss)
The torch loss, i.e. the one of the graph's PipeOpTorchLoss. Read-only, the graph configures it.

optimizer

(TorchOptimizer)
The torch optimizer, i.e. the one of the graph's PipeOpTorchOptimizer. Read-only, the graph configures it.

callbacks

(list() of TorchCallbacks)
The callbacks, i.e. those of the graph's PipeOpTorchCallbacks. Read-only, the graph configures them.

Methods

Inherited methods


GraphLearnerTorch$dataset()

Create the dataset for a task, i.e. the tensors that are fed to the network.

Usage

GraphLearnerTorch$dataset(
  task,
  stage = if (is.null(self$model)) "train" else "predict"
)

Arguments

task

Task
The task.

stage

(character(1))
Whether to create the dataset the way $train() does ("train") or the way $predict() does ("predict"). Defaults to "predict" for a trained learner and to "train" otherwise, because the prediction phase reuses the state that the operators before the ingress fitted during training.

Returns

dataset


GraphLearnerTorch$clone()

The objects of this class are cloneable with this method.

Usage

GraphLearnerTorch$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.