layer_generator {deepregression}R Documentation

Function that creates layer for each processor

Description

Function that creates layer for each processor

Usage

layer_generator(
  term,
  output_dim,
  param_nr,
  controls,
  layer_class = tf$keras$layers$Dense,
  without_layer = tf$identity,
  name = makelayername(term, param_nr),
  further_layer_args = NULL,
  layer_args_names = NULL,
  units = as.integer(output_dim),
  ...
)

int_processor(term, data, output_dim, param_nr, controls)

lin_processor(term, data, output_dim, param_nr, controls)

gam_processor(term, data, output_dim, param_nr, controls)

Arguments

term

character; term in the formula

output_dim

integer; number of units in the layer

param_nr

integer; identifier for models with more than one additive predictor

controls

list; control arguments which allow to pass further information

layer_class

a tf or keras layer function

without_layer

function to be used as layer if controls$with_layer is FALSE

name

character; name of layer. if NULL, makelayername will be used to create layer name

further_layer_args

named list; further arguments passed to the layer

layer_args_names

character vector; if NULL, default layer args will be used. Needs to be set for layers that do not provide the arguments of a default Dense layer.

units

integer; number of units for layer

...

other keras layer parameters

data

data frame; the data used in processors

Value

a basic processor list structure


[Package deepregression version 1.0.0 Index]