Skip to contents

Dictionary of torch loss descriptors. See t_loss() for conveniently retrieving a loss function. Can be converted to a data.table using as.data.table.

Usage

mlr3torch_losses

Format

An object of class DictionaryMlr3torchLosses (inherits from Dictionary, R6) of length 13.

Available Loss Functions

cross_entropy, l1, mse

Examples

mlr3torch_losses$get("mse")
#> <TorchLoss:mse> Mean Squared Error
#> * Generator: nn_mse_loss
#> * Parameters: list()
#> * Packages: torch,mlr3torch
#> * Task Types: regr
# is equivalent to
t_loss("mse")
#> <TorchLoss:mse> Mean Squared Error
#> * Generator: nn_mse_loss
#> * Parameters: list()
#> * Packages: torch,mlr3torch
#> * Task Types: regr
# convert to a data.table
as.data.table(mlr3torch_losses)
#> Key: <key>
#>              key              label task_types        packages
#>           <char>             <char>     <list>          <char>
#> 1: cross_entropy      Cross Entropy    classif torch,mlr3torch
#> 2:            l1     Absolute Error       regr torch,mlr3torch
#> 3:           mse Mean Squared Error       regr torch,mlr3torch