Open
Description
The general approach would be to:
- Define a
TaskClassifTorch
where the target feature type is alazy_tensor
(a long) - Define a
TaskRegrTorch
where the target feature type is alazy_tensor
(float)
Because we don't want to reimplement everything (measures, learners), we need a way to convert this to a TaskClassif
and TaskRegr
respectively.
For this we need a custom DataBackend
that returns the target as a numeric
(regr) or factor
(classif).
However, this DataBackendTorch
should also have a method to directly retrieve the underlying tensor data which will be used by the LearnerTorch
when iterating the batches.
We then need converters
as_task_classif.TaskClassifTorch
as_task_classif.TaskRegrTorch
The whole code for e.g. using torchvision::dataset_mnist()
would then be:
ds = dataset_mnist()
task = as_task_classif(ds, target = "y", input_shapes = list(...))
learner = lrn("classif.alexnet")
learner$train(task)
Metadata
Metadata
Assignees
Labels
No labels