@@ -823,8 +823,6 @@ parameters.
823823If ` lambda ` and ` sigma ` are not specified, then 0 is used as the initial value
824824for all Lagrange multipliers and 10 is used as the initial penalty parameter.
825825
826- </details >
827-
828826#### Examples
829827
830828<details open >
@@ -1261,6 +1259,70 @@ optimizer.Optimize(f, coordinates);
12611259 * [ Differential Evolution in Wikipedia] ( https://en.wikipedia.org/wiki/Differential_Evolution )
12621260 * [ Arbitrary functions] ( #arbitrary-functions )
12631261
1262+ ## DeltaBarDelta
1263+
1264+ * An optimizer for [ differentiable functions] ( #differentiable-functions ) .*
1265+
1266+ A Gradient Descent variant that adapts learning rates for each parameter to improve convergence. If the current gradient and the exponential average of past gradients corresponding to a parameter have the same sign, then the step size for that parameter is incremented by ` kappa ` . Otherwise, it is decreased by a proportion ` phi ` of its current value (additive increase, multiplicative decrease).
1267+
1268+ *** Notes:***
1269+
1270+ - DeltaBarDelta is very sensitive to its parameters (` kappa ` and ` phi ` ) hence a good
1271+ hyperparameter selection is necessary as its default may not fit every case.
1272+ Typically, ` kappa ` should be smaller than the step size.
1273+
1274+ - This implementation uses a minStepSize parameter to set a lower bound for the learning
1275+ rate. This prevents the learning rate from dropping to zero, which can occur due to
1276+ floating-point underflow. For tasks which require extreme fine-tuning, you may need to
1277+ lower this parameter below its default value (1e-8) in order to allow for smaller
1278+ learning rates.
1279+
1280+ #### Constructors
1281+
1282+ * ` DeltaBarDelta() `
1283+ * ` DeltaBarDelta( ` _ ` stepSize ` _ ` ) `
1284+ * ` DeltaBarDelta( ` _ ` stepSize, maxIterations, tolerance ` _ ` ) `
1285+ * ` DeltaBarDelta( ` _ ` stepSize, maxIterations, tolerance, kappa, phi, theta, minStepSize, resetPolicy ` _ ` ) `
1286+
1287+ #### Attributes
1288+
1289+ | ** type** | ** name** | ** description** | ** default** |
1290+ | ----------| ----------| -----------------| -------------|
1291+ | ` double ` | ** ` stepSize ` ** | Initial step size. | ` 1.0 ` |
1292+ | ` size_t ` | ** ` maxIterations ` ** | Maximum number of iterations allowed (0 means no limit). | ` 100000 ` |
1293+ | ` double ` | ** ` tolerance ` ** | Maximum absolute tolerance to terminate algorithm. | ` 1e-5 ` |
1294+ | ` double ` | ** ` kappa ` ** | Additive increase constant for step size when gradient signs persist. | ` 0.2 ` |
1295+ | ` double ` | ** ` phi ` ** | Multiplicative decrease factor for step size when gradient signs flip. | ` 0.2 ` |
1296+ | ` double ` | ** ` theta ` ** | Decay rate for computing the exponential average of past gradients. | ` 0.5 ` |
1297+ | ` double ` | ** ` minStepSize ` ** | Minimum allowed step size for any parameter. | ` 1e-8 ` |
1298+ | ` bool ` | ** ` resetPolicy ` ** | If true, parameters are reset before every ` Optimize() ` call. | ` true ` |
1299+
1300+ Attributes of the optimizer may also be modified via the member methods
1301+ ` StepSize() ` , ` MaxIterations() ` , ` Tolerance() ` , ` Kappa() ` , ` Phi() ` , ` Theta() ` , ` MinStepSize() ` and ` ResetPolicy() ` .
1302+
1303+
1304+ #### Examples:
1305+
1306+ <details open >
1307+ <summary >Click to collapse/expand example code.
1308+ </summary >
1309+
1310+ ``` c++
1311+ RosenbrockFunction f;
1312+ arma::mat coordinates = f.GetInitialPoint();
1313+
1314+ DeltaBarDelta optimizer (0.001, 0, 1e-15, 0.0001, 0.2, 0.8);
1315+ optimizer.Optimize(f, coordinates);
1316+ ```
1317+
1318+ </details>
1319+
1320+ #### See also:
1321+
1322+ * [Increased rates of convergence through learning rate adaptation (pdf)](https://www.academia.edu/download/32005051/Jacobs.NN88.pdf)
1323+ * [Differentiable functions](#differentiable-functions)
1324+ * [Gradient Descent](#gradient-descent)
1325+
12641326## DemonAdam
12651327
12661328*An optimizer for [differentiable separable functions](#differentiable-separable-functions).*
@@ -1894,11 +1956,17 @@ Gradient Descent is a technique to minimize a function. To find a local minimum
18941956of a function using gradient descent, one takes steps proportional to the
18951957negative of the gradient of the function at the current point.
18961958
1959+ Note that Gradient Descent is an extremely simple optimizer. For more advanced, adaptive optimizers, consider DeltaBarDelta, MomentumDeltaBarDelta, or established stochastic variants such as Adam, RMSProp, and AdaGrad.
1960+
18971961#### Constructors
18981962
18991963 * ` GradientDescent() `
19001964 * ` GradientDescent( ` _ ` stepSize ` _ ` ) `
19011965 * ` GradientDescent( ` _ ` stepSize, maxIterations, tolerance ` _ ` ) `
1966+ * ` GradientDescent( ` _ ` stepSize, maxIterations, tolerance, updatePolicy, decayPolicy, resetPolicy ` _ ` ) `
1967+
1968+ Note that ` GradientDescent ` is based on the templated type
1969+ ` GradientDescentType< ` _ ` UpdatePolicyType, DecayPolicyType ` _ ` > ` with _ ` UpdatePolicyType ` _ ` = VanillaUpdate ` and _ ` DecayPolicyType ` _ ` = NoDecay ` .
19021970
19031971#### Attributes
19041972
@@ -1909,7 +1977,9 @@ negative of the gradient of the function at the current point.
19091977| ` size_t ` | ** ` tolerance ` ** | Maximum absolute tolerance to terminate algorithm. | ` 1e-5 ` |
19101978
19111979Attributes of the optimizer may also be changed via the member methods
1912- `StepSize()`, `MaxIterations()`, and `Tolerance()`.
1980+ ` StepSize() ` , ` MaxIterations() ` , ` Tolerance() ` , ` UpdatePolicy() ` ,
1981+ ` DecayPolicy() ` , and ` ResetPolicy() ` .
1982+
19131983
19141984#### Examples:
19151985
@@ -2396,6 +2466,67 @@ for all Lagrange multipliers and 10 is used as the initial penalty parameter.
23962466 * [Semidefinite programming on Wikipedia](https://en.wikipedia.org/wiki/Semidefinite_programming)
23972467 * [Semidefinite programs](#semidefinite-programs) (includes example usage of `PrimalDualSolver`)
23982468
2469+ ## Momentum DeltaBarDelta
2470+
2471+ *An optimizer for [differentiable functions](#differentiable-functions).*
2472+
2473+ A [DeltaBarDelta](#deltabardelta) variant that incorporates the following modifications:
2474+ - In the original DeltaBarDelta, the momentum term (`delta_bar`) is used
2475+ solely for sign comparison with the current gradient and does not
2476+ participate in the parameter update. In this modified variant, the
2477+ momentum term (`velocity`) is directly used to update the parameters.
2478+ - Instead of adjusting the step size directly, each parameter maintains
2479+ a gain value initialized to 1.0. Updates apply additive increases or
2480+ multiplicative decreases to this gain. The effective step size for a
2481+ parameter is the product of its initial step size and its current gain.
2482+
2483+ Note: This variant originates from optimization of the t-SNE cost function.
2484+
2485+ #### Constructors
2486+
2487+ * `MomentumDeltaBarDelta()`
2488+ * `MomentumDeltaBarDelta(`_`stepSize`_`)`
2489+ * `MomentumDeltaBarDelta(`_`stepSize, maxIterations, tolerance`_`)`
2490+ * `MomentumDeltaBarDelta(`_`stepSize, maxIterations, tolerance, kappa, phi, momentum, minGain, resetPolicy`_`)`
2491+
2492+ #### Attributes
2493+
2494+ | **type** | **name** | **description** | **default** |
2495+ |----------|----------|-----------------|-------------|
2496+ | `double` | **`stepSize`** | Initial step size. | `1.0` |
2497+ | `size_t` | **`maxIterations`** | Maximum number of iterations allowed (0 means no limit). | `100000` |
2498+ | `double` | **`tolerance`** | Maximum absolute tolerance to terminate algorithm. | `1e-5` |
2499+ | `double` | **`kappa`** | Additive increase constant for step size. | `0.2` |
2500+ | `double` | **`phi`** | Multiplicative decrease factor for step size. | `0.8` |
2501+ | `double` | **`momentum`** | The momentum hyperparameter. | `0.5` |
2502+ | `double` | **`minGain`** | Minimum allowed gain (scaling factor) for any parameter. | `1e-8` |
2503+ | `bool` | **`resetPolicy`** | If true, parameters are reset before every `Optimize()` call. | `true` |
2504+
2505+ Attributes of the optimizer may also be modified via the member methods
2506+ `StepSize()`, `MaxIterations()`, `Tolerance()`, `Kappa()`, `Phi()`, `Momentum()`, `MinGain()`, and `ResetPolicy()`.
2507+
2508+ #### Examples:
2509+
2510+ <details open>
2511+ <summary>Click to collapse/expand example code.
2512+ </summary>
2513+
2514+ ```c++
2515+ RosenbrockFunction f;
2516+ arma::mat coordinates = f.GetInitialPoint();
2517+
2518+ MomentumDeltaBarDelta optimizer(0.001, 0, 1e-15, 0.2, 0.8, 0.5);
2519+ optimizer.Optimize(f, coordinates);
2520+ ```
2521+
2522+ </details >
2523+
2524+ #### See also:
2525+ * [ t-SNE Implementations] ( https://lvdmaaten.github.io/tsne/ )
2526+ * [ Increased rates of convergence through learning rate adaptation (pdf)] ( https://www.academia.edu/download/32005051/Jacobs.NN88.pdf )
2527+ * [ Differentiable functions] ( #differentiable-functions )
2528+ * [ Gradient Descent] ( #gradient-descent )
2529+
23992530## Momentum SGD
24002531
24012532* An optimizer for [ differentiable separable functions] ( #differentiable-separable-functions ) .*
0 commit comments