Learn R Programming

deepregression (version 2.2.0)

torch_dr: Compile a Deep Distributional Regression Model (Torch)

Description

Compile a Deep Distributional Regression Model (Torch)

Usage

torch_dr(
  list_pred_param,
  optimizer = torch::optim_adam,
  model_fun = NULL,
  monitor_metrics = list(),
  from_preds_to_output = from_preds_to_dist_torch,
  loss = from_dist_to_loss_torch(family = list(...)$family, weights = NULL),
  additional_penalty = NULL,
  ...
)

Value

a luz_module_generator

Arguments

list_pred_param

list of output(-lists) generated from subnetwork_init

optimizer

optimizer used. Per default Adam

model_fun

NULL not needed for torch

monitor_metrics

Further metrics to monitor

from_preds_to_output

function taking the list_pred_param outputs and transforms it into a single network output

loss

the model's loss function; per default evaluated based on the arguments family and weights using from_dist_to_loss

additional_penalty

a penalty that is added to the negative log-likelihood; must be a function of model$trainable_weights with suitable subsetting (not implemented for torch)

...

arguments passed to from_preds_to_output

weights

vector of positive values; optional (default = 1 for all observations)