Torch Entry Point for Categorical Features
Source:R/PipeOpTorchIngress.R
mlr_pipeops_torch_ingress_categ.RdIngress PipeOp that represents a categorical (factor(), ordered() and logical()) entry point to a torch network.
Parameters
select::logical(1)
WhetherPipeOpshould selected the supported feature types. Otherwise it will err on receiving tasks with unsupported feature types.
Internals
Uses batchgetter_categ().
Input and Output Channels
One input channel called "input" and one output channel called "output".
For an explanation see PipeOpTorch.
See also
Other Graph Network:
ModelDescriptor(),
TorchIngressToken(),
mlr_learners_torch_model,
mlr_pipeops_module,
mlr_pipeops_torch,
mlr_pipeops_torch_ingress,
mlr_pipeops_torch_ingress_ltnsr,
mlr_pipeops_torch_ingress_num,
model_descriptor_to_learner(),
model_descriptor_to_module(),
model_descriptor_union(),
nn_graph()
Super classes
mlr3pipelines::PipeOp -> PipeOpTorchIngress -> PipeOpTorchIngressCategorical
Methods
PipeOpTorchIngressCategorical$new()
Creates a new instance of this R6 class.
Usage
PipeOpTorchIngressCategorical$new(
id = "torch_ingress_categ",
param_vals = list()
)Arguments
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.
Examples
graph = po("select", selector = selector_type("factor")) %>>%
po("torch_ingress_categ")
task = tsk("german_credit")
# The output is a model descriptor
md = graph$train(task)[[1L]]
ingress = md$ingress[[1L]]
ingress$batchgetter(task$data(1, ingress$features(task)), "cpu")
#> torch_tensor
#> 5 5 1 2 3 1 3 1 3 1 4 5 1 2
#> [ CPULongType{1,14} ]