get_init: Get Pytorch Weight Initialization Method

Description Usage Arguments Details

View source: R/helpers.R

Description

Helper function to return a character string with a populated pytorch weight initializer method from torch.nn.init. Used in build_pytorch_net to define a weighting function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get_init(
  init = "uniform",
  a = 0,
  b = 1,
  mean = 0,
  std = 1,
  val,
  gain = 1,
  mode = c("fan_in", "fan_out"),
  non_linearity = c("leaky_relu", "relu")
)

Arguments

init

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

a

(numeric(1))
Passed to uniform, kaiming_uniform, and kaiming_normal.

b

(numeric(1))
Passed to uniform.

mean, std

(numeric(1))
Passed to normal.

val

(numeric(1))
Passed to constant.

gain

(numeric(1))
Passed to xavier_uniform, xavier_normal, and orthogonal.

mode

(character(1))
Passed to kaiming_uniform and kaiming_normal, one of fan_in (default) and fan_out.

non_linearity

(character(1))
Passed to kaiming_uniform and kaiming_normal, one of leaky_relu (default) and relu.

Details

Implemented methods (with help pages) are


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