deeppam: Construct a DeepPAM model with mgcv and keras.

Description Usage Arguments Value Author(s)

View source: R/deeppam.R

Description

This function constructs a DeepPAM as described in Kopper et al. 2020. It combines different deep models and a structured PAM(M) to a single deep keras model.

Usage

1
2
3
4
5
6
7
8
9
deeppam(
  networks_unstructured = list(),
  structured_ped,
  interactions = FALSE,
  warm_start = FALSE,
  trainable_structured = TRUE,
  orthogonal = FALSE,
  ...
)

Arguments

networks_unstructured

A list of all unstrctured deep models to be considered in the DeepPAM. If empty, a PAM will be constructed. Each entry of the list must be a list itself featuring two entries: The input_layer and the net itself. For example this is a working input: image_input <- layer_input(shape = dim(unstructured_data$image)[2:3]) image_output <- image_input layer_conv_1d(1, 1, trainable = FALSE, kernel_initializer = initializer_constant(0), bias_initializer = initializer_constant(0)) layer_global_max_pooling_1d() layer_dense(1, "linear", trainable = FALSE, kernel_initializer = initializer_constant(0)) image_model <- list(input = image_input, output = image_output) networks_unstructured <- list(image = image_model) You may find the tutorial / vignette useful.

structured_ped

an object of class ped_tensor constructed using from_ped_to_tensor(). This is the tensor that is used to fit the structured part of the DeepPAM.

interactions

Not implemented yet, thus must be FALSE. However, this argument indicates whether the separate sub networks are supposed to interact with one another. The argument should be a boolean or a matrix featuring booleans. The matrix should indicate which sub nets should interact.

warm_start

logical. Should the PAM part be initialised with the values from a fit of pammtools::pamm()?

trainable_structured

logical. Should the PAM part be frozen during training (FALSE) or trainable (TRUE)?

orthogonal

Not implemented yet, thus must be FALSE. However, this argument indicates whether there should be an orthogonalisation (as proposed in Ruegamer et al. (2020)) layer. Either a single boolean or a vector of booleans.

...

potential futher arguments.

Value

a keras model of class "deeppam". The object can use all regular keras methods, such as compile or fit in the regular manner. However, for fitting, make use of the weights that are stored in attr(structured_ped, "weights"). More details are available in the tutorial.

Author(s)

Philipp Kopper


pkopper/deeppam documentation built on Jan. 19, 2021, 12:39 a.m.