pybop.optimisers._gradient_descent#
Classes#
Gradient descent method with a fixed, per-dimension learning rate. |
Module Contents#
- class pybop.optimisers._gradient_descent.GradientDescentImpl(x0: numpy.ndarray, sigma0: list[float] | None, boundaries: pints.Boundaries | None)[source]#
Bases:
pints.OptimiserGradient descent method with a fixed, per-dimension learning rate.
Gradient descent updates the current position in the direction of the steepest descent, as determined by the negative of the gradient of the function.
The update rule for each iteration is given by:
\[x_{t+1} = x_t - \eta * \nabla f(x_t)\]- where:
\(x_t\) are the current parameter values at iteration t,
\(\nabla f(x_t)\) is the gradient of the function at \(x_t\),
\(\eta\) is the learning rate, which controls the step size.
This class reimplements the Pints’ Gradient Descent, but with multidimensional, fixed learning rates. Original creation and credit is attributed to Pints.
- Parameters:
x0 (array-like) – Initial starting point for the optimisation. This should be a 1D array representing the starting parameter values for the function being optimised.
sigma0 (float or array-like, optional) – Initial learning rate or rates for each dimension. If a scalar is provided, the same learning rate is applied across all dimensions. If an array is provided, each dimension will have its own learning rate (default: 0.02).
boundaries (pybop.Boundaries, optional) – Boundaries for the parameters. This optimiser ignores boundaries and operates as an unbounded method (default: None).
- _x_best#
The best parameter values (solution) found so far.
- Type:
array-like
- _current#
The current parameter values at the latest iteration.
- Type:
array-like
- _eta[source]#
The current learning rate(s). Can be a scalar or per-dimension array.
- Type:
array-like
- _ready_for_tell[source]#
Indicates whether the optimiser is ready to receive feedback from the objective function.
- Type:
bool