Skip to contents

This class defines gradient descent

Super classes

vistool::Optimizer -> vistool::OptimizerMomentum -> OptimizerGD

Active bindings

momentum

(numeric(1)) Momentum of the algorithm.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

OptimizerGD$new(
  objective,
  x_start,
  lr = 0.01,
  id = "Gradient Descent",
  print_trace = TRUE
)

Arguments

objective

(Objective)
The objective to optimize.

x_start

(numeric())
Start value of the optimization. Note, after the first call of $optimize() the last value is used to continue optimization. Get this value with $x.

lr

(numeric(1))
Step size with which the update is multiplied.

id

(character(1))
Id of the object.

print_trace

(logical(1))
Indicator whether to print the status of $optimize().


Method clone()

The objects of this class are cloneable with this method.

Usage

OptimizerGD$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.