get_activation: Get Pytorch Activation Function

Description Usage Arguments Details

View source: R/helpers.R

Description

Helper function to return a class or constructed object for pytorch activation function from torch.nn.modules.activation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
get_activation(
  activation = "relu",
  construct = TRUE,
  alpha = 1,
  dim = NULL,
  lambd = 0.5,
  min_val = -1,
  max_val = 1,
  negative_slope = 0.01,
  num_parameters = 1L,
  init = 0.25,
  lower = 1/8,
  upper = 1/3,
  beta = 1,
  threshold = 20,
  value = 20
)

Arguments

activation

(character(1))
Activation function method, see details for list of implemented methods.

construct

(logical(1))
If TRUE (default) returns constructed object, otherwise a class.

alpha

(numeric(1))
Passed to celu and elu.

dim

(integer(1))
Passed to glu, logsoftmax, softmax, and softmin.

lambd

(numeric(1))
Passed to hardshrink and softshrink.

min_val, max_val

(numeric(1))
Passed to hardtanh.

negative_slope

(numeric(1))
Passed to leakyrelu.

num_parameters

(integer(1))
Passed to prelu.

init

(numeric(1))
Passed to prelu.

lower, upper

(numeric(1))
Passed to rrelu.

beta

(numeric(1))
Passed to softplus.

threshold

(numeric(1))
Passed to softplus and threshold.

value

(numeric(1))
Passed to threshold.

Details

Implemented methods (with help pages) are


mlr3learners/mlr3learners.pycox documentation built on Sept. 24, 2020, 10:40 a.m.