LibCapy - gradientDescent

Class implementing the gradient descent method.

Macros:

Enumerations:

Type of gradient descent

Typedefs:

None.

Struct CapyGradientDescent :

Struct CapyGradientDescent's properties:

Current step

Current position in the input space

Learn rate (default: 0.1)

Decay rates for adam (default: [0.9, 0.999] The higher decayRates[0], the more the recent moment is taken into account The higher decayRates[1], the more stable the estimate of the variance decayRates[1] should be as near to 1 as possible for stable convergence

Epsilon for adam (default: 1e-8)

Momentum (default: 0)

Current first moments

Current second moments

Current gradient

Reference to the objective function

Struct CapyGradientDescent's methods:

Destructor

Perform one step of the gradient descent method

Output and side effect(s):

that.in and that.gradient are updated

Set the type of the gradient descent

Input argument(s):

type: the type of gradient descent

Output and side effect(s):

Set the type of gradient descent

Functions:

Create a CapyGradientDescent

Input argument(s):

objFun: objective function (must have dimOut = 1)
initIn: initial position in input space (must be of dimension objFun.dimIn)

Output and side effect(s):

Return a CapyGradientDescent (of standard type)

Allocate memory for a new CapyGradientDescent and create it

Input argument(s):

objFun: objective function (must have dimOut = 1)
initIn: initial position in input space (must be of dimension objFun.dimIn)

Output and side effect(s):

Return a CapyGradientDescent (of standard type)

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyGradientDescent* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyGradientDescent to free

2023-03-26
in LibCapy,
42 views
Copyright 2021-2025 Baillehache Pascal