optimizer_sgd: Stochastic gradient descent (SGD) optimizer

View source: R/kerasOptimizer.R

optimizer_sgdR Documentation

Stochastic gradient descent (SGD) optimizer

Description

Stochastic gradient descent optimizer with support for momentum, learning rate decay, and Nesterov momentum.

Usage

optimizer_sgd(
  learning_rate = 0.01,
  momentum = 0,
  decay = 0,
  nesterov = FALSE,
  clipnorm = NULL,
  clipvalue = NULL,
  ...
)

Arguments

learning_rate

float >= 0. Learning rate.

momentum

float >= 0. Parameter that accelerates SGD in the relevant direction and dampens oscillations.

decay

float >= 0. Learning rate decay over each update.

nesterov

boolean. Whether to apply Nesterov momentum.

clipnorm

Gradients will be clipped when their L2 norm exceeds this value.

clipvalue

Gradients will be clipped when their absolute value exceeds this value.

...

Unused, present only for backwards compatability

Details

Based on: [keras/R/optimizers.R](https://github.com/rstudio/keras/blob/main/R/optimizers.R). The following code is commented: backcompat_fix_rename_lr_to_learning_rate(...)

Value

Optimizer for use with compile.keras.engine.training.Model.

Note

To enable compatibility with the ranges of the learning rates of the other optimizers, the learning rate learning_rate is internally mapped to 10 * learning_rate. That is, a learning rat of 0.001 will be mapped to 0.01 (which is the default.)

See Also

Other optimizers: optimizer_adadelta(), optimizer_adagrad(), optimizer_adamax(), optimizer_adam(), optimizer_nadam(), optimizer_rmsprop()


SPOTMisc documentation built on Sept. 5, 2022, 5:06 p.m.