Nesterovs momentum optimizer
OptimizerNAG.RdThis class defines Nesterovs momentum using Nesterov accelerated gradient (NAG).
Super class
vistool::Optimizer -> OptimizerNAG
Methods
Method new()
Creates a new instance of this R6 class.
Usage
OptimizerNAG$new(
objective,
x_start,
lr = 0.01,
momentum = 0.9,
id = "NAG",
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.momentum(
numeric(1))
Momentum value.id(
character(1))
Id of the object.print_trace(
logical(1))
Indicator whether to print the status of$optimize().
Method optimize()
Optimize steps iteration.
Usage
OptimizerNAG$optimize(
steps = 1L,
step_size_control = function(x, u, obj, opt) {
return(1)
},
minimize = NULL
)Arguments
steps(
integer(1))
Number of steps/iterations.step_size_control(
function()) A function with argumentsx(the old input value),u(the update generated by$update()), andobj(the objective object).minimize(
logical(1)) Indicator to whether minimize or optimize the objective. The default (NULL) uses the option defined inobjective$minimize.
Method update()
Calculate the update for x