Learn R Programming

survivalmodels (version 0.1.9)

get_keras_optimizer: Get Keras Optimizer

Description

Utility function to construct optimiser from keras, primarily for internal use.

Usage

get_keras_optimizer(
  optimizer = "adam",
  lr = 0.02,
  beta_1 = 0.9,
  beta_2 = 0.999,
  epsilon = NULL,
  decay = 0,
  clipnorm = NULL,
  clipvalue = NULL,
  schedule_decay = 0.004,
  momentum = 0,
  nesterov = FALSE
)

Arguments

optimizer

(character(1)) Optimizer to construct, see details for those available. Default is "adam".

lr

(numeric(1)) Passed to all optimizers except adadelta and adagrad.

beta_1, beta_2, epsilon

(numeric(1)) Passed to adamax, adam, and nadam.

decay

(numeric(1)) Passed to adamax, adam, and sgd.

clipnorm, clipvalue

(numeric(1)) Passed to adamax, adam, nadam, and sgd.

schedule_decay

(numeric(1)) Passed to nadam.

momentum

(numeric(1)) Passed to sgd.

nesterov

(logical(1)) Passed to sgd.

Details

Implemented optimizers are

Examples

Run this code
# NOT RUN {
if (requireNamespaces("keras")) {
  get_keras_optimizer()

  get_keras_optimizer(optimizer = "adamax", decay = 0.1, lr = 0.01)
}
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab