Skip to contents

A fully-connected network (or multi-layer perception) as a torch::nn_module, designed for generalized Pareto distribution parameter prediction.

Usage

FC_GPD_net(
  D_in,
  Hidden_vect = c(5, 5, 5),
  activation = torch::nnf_sigmoid,
  p_drop = 0,
  shape_fixed = FALSE,
  device = default_device()
)

Arguments

D_in

the input size (i.e. the number of features),

Hidden_vect

a vector of integers whose length determines the number of layers in the neural network and entries the number of neurons in each corresponding successive layer,

activation

the activation function for the hidden layers (should be either a callable function, preferably from the torch library),

p_drop

probability parameter for dropout before each hidden layer for regularization during training,

shape_fixed

whether the shape estimate depends on the covariates or not (bool),

device

a torch::torch_device() for an internal constant vector. Defaults to default_device().

Details

The constructor allows specifying:

  • D_inthe input size (i.e. the number of features),

  • Hidden_vecta vector of integers whose length determines the number of layers in the neural network and entries the number of neurons in each corresponding successive layer,

  • activationthe activation function for the hidden layers (should be either a callable function, preferably from the torch library),

  • p_dropprobability parameter for dropout before each hidden layer for regularization during training,

  • shape_fixedwhether the shape estimate depends on the covariates or not (bool),

  • devicea torch::torch_device() for an internal constant vector. Defaults to default_device().