deepregression_init: Initializing Deep Distributional Regression Models

View source: R/deepregression.R

deepregression_initR Documentation

Initializing Deep Distributional Regression Models

Description

Initializing Deep Distributional Regression Models

Usage

deepregression_init(
  n_obs,
  ncol_structured,
  ncol_deep,
  list_structured,
  list_deep,
  use_bias_in_structured = FALSE,
  nr_params = 2,
  train_together = NULL,
  lambda_lasso = NULL,
  lambda_ridge = NULL,
  family,
  dist_fun = NULL,
  variational = TRUE,
  weights = NULL,
  learning_rate = 0.01,
  optimizer = optimizer_adam(lr = learning_rate),
  monitor_metric = list(),
  posterior = posterior_mean_field,
  prior = prior_trainable,
  orthog_fun = orthog,
  orthogX = NULL,
  kl_weight = 1/n_obs,
  output_dim = 1,
  mixture_dist = FALSE,
  split_fun = split_model,
  ind_fun = function(x) x,
  extend_output_dim = 0,
  offset = NULL,
  additional_penalty = NULL,
  constraint_fun = NULL,
  compile_model = TRUE
)

Arguments

n_obs

number of observations

ncol_structured

a vector of length #parameters defining the number of variables used for each of the parameters. If any of the parameters is not modelled using a structured part the corresponding entry must be zero.

ncol_deep

a vector of length #parameters defining the number of variables used for each of the parameters. If any of the parameters is not modelled using a deep part the corresponding entry must be zero. If all parameters are estimated by the same deep model, the first entry must be non-zero while the others must be zero.

list_structured

list of (non-linear) structured layers (list length between 0 and number of parameters)

list_deep

list of deep models to be used (list length between 0 and number of parameters)

use_bias_in_structured

logical, whether or not to use a bias in structured layer

nr_params

number of distribution parameters

train_together

see ?deepregression

lambda_lasso

penalty parameter for l1 penalty of structured layers

lambda_ridge

penalty parameter for l2 penalty of structured layers

family

family specifying the distribution that is modelled

dist_fun

a custom distribution applied to the last layer, see make_tfd_dist for more details on how to construct a custom distribution function.

variational

logical value specifying whether or not to use variational inference. If TRUE, details must be passed to the via the ellipsis to the initialization function

weights

observation weights used in the likelihood

learning_rate

learning rate for optimizer

optimizer

optimizer used (defaults to adam)

monitor_metric

see ?deepregression

posterior

function defining the posterior

prior

function defining the prior

orthog_fun

function defining the orthogonalization

orthogX

vector of columns defining the orthgonalization layer

kl_weight

KL weights for variational networks

output_dim

dimension of the output (> 1 for multivariate outcomes)

mixture_dist

see ?deepregression

split_fun

see ?deepregression

ind_fun

see ?deepregression

extend_output_dim

see ?deepregression

offset

list of logicals corresponding to the paramters; defines per parameter if an offset should be added to the predictor

additional_penalty

to specify any additional penalty, provide a function that takes the model$trainable_weights as input and applies the additional penalty. In order to get the correct index for the trainable weights, you can run the model once and check its structure.

constraint_fun

function; a constraint for the linear layers

compile_model

logical; whether to compile the model (default is TRUE)

fsbatch_optimizer

logical; see ?deepregression


davidruegamer/deepregression documentation built on May 30, 2022, 6:21 p.m.