ConjugateGradientOptimizerOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.Models.Options

Configuration options for the Conjugate Gradient optimization algorithm, which is used to train machine learning models.

Inheritance: ModelOptions → OptimizationAlgorithmOptions<T, TInput, TOutput> → GradientBasedOptimizerOptions<T, TInput, TOutput> → ConjugateGradientOptimizerOptions<T, TInput, TOutput>

For Beginners

Think of training a machine learning model like finding the lowest point in a valley. The Conjugate Gradient method is like a smart hiker who remembers previous paths they’ve taken and uses that information to find shortcuts to the bottom. This is often faster than basic methods that only look at the current slope. This class lets you control how this “smart hiker” behaves - how big steps they take, when they decide they’re close enough to the bottom, and how many attempts they’ll make before giving up.

How It Works

The Conjugate Gradient method is an advanced optimization algorithm that often converges faster than standard gradient descent. It uses information from previous iterations to determine more efficient search directions, making it particularly effective for problems with many parameters.

Constructors

Constructor Summary
ConjugateGradientOptimizerOptions() Initializes a new instance of the ConjugateGradientOptimizerOptions class with appropriate defaults.

Properties

Property Summary
bool UseLineSearch { get; set; } Gets or sets whether a training step backtracks along its Conjugate gradient step when the full step does not lower the loss.
double InitialLearningRate { get; set; } Gets or sets the initial learning rate, which controls the size of the first optimization steps.
double LearningRateDecreaseFactor { get; set; } Gets or sets the factor by which to decrease the learning rate when progress stalls or errors increase.
double LearningRateIncreaseFactor { get; set; } Gets or sets the factor by which to increase the learning rate when progress is good.
double MaxLearningRate { get; set; } Gets or sets the maximum learning rate, which prevents the steps from becoming too large.
double MinLearningRate { get; set; } Gets or sets the minimum learning rate, which prevents the steps from becoming too small.
int BatchSize { get; set; } Gets or sets the batch size for gradient computation.
int MaxLineSearchIterations { get; set; } Gets or sets how many times a failing training step is halved before it is rejected outright.