control.hann: Parameters for Neural Network Optimization

View source: R/common.R

control.hannR Documentation

Parameters for Neural Network Optimization

Description

Set the parameters for the Hopfield artificial neural network optimization.

Usage

control.hann(...)

Arguments

...

named arguments to be modified (see examples).

Details

When the user modifies one or several parameters by giving them as named arguments, if some names are incorrect they are ignored with a warning.

The parameters with their default values are:

  • iterlim = 100: an integer giving the number of iterations.

  • quiet = FALSE: a logical controlling whether to print the value of the objective (loss) function at each iteration.

  • quasinewton = FALSE: a logical. If TRUE, quasi-Newton steps are performed (not recommended unless for networks with few parameters and/or for a small number of iterations).

  • fullhessian = FALSE: (ignored if quasinewton = FALSE) a logical, by default only some blocks of the Hessian matrix are computed. If TRUE, the full Hessian matrix is computed (very time consuming).

  • trace.error = FALSE: a logical. If TRUE, the error rate is printed at each iteration of the optimization process.

  • wolfe = FALSE: a logical. If TRUE, Wolfe's conditions are tested and printed at each iteration.

  • target = 0.001: the target value of the loss function to stop the optimization.

  • beta = 0.2: the hyperparameter of the activation function.

  • mc.cores = 1: an integer. The number of cores used when computing the loss function.

If mc.cores is greater than one, the optimization process calls a multithreaded code using OMP. So, do not do this together with functions from the package parallel. On the other hand, if you leave this parameter to its default value, you should be able to run several optimizations in parallel, for instance with mclapply.

See the vignette for applications.

Value

a list with named elements as detailed above.

Note

For the moment, the parameter mc.cores is accepted only by hann1.

Author(s)

Emmanuel Paradis

References

https://en.wikipedia.org/wiki/Wolfe_conditions

See Also

hann1

Examples

control.hann() # default values
ctrl <- control.hann(iterlim = 1000)
ctrl

## verbose is not a parameter:
ctrl <- control.hann(iterlim = 1000, verbose = TRUE)

hann documentation built on Aug. 8, 2025, 7:16 p.m.