Skip to content

Commit c529ed3

Browse files
Update Docs
1 parent ab5d486 commit c529ed3

2 files changed

Lines changed: 70 additions & 1 deletion

File tree

doc/function_types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ The following optimizers can be used with differentiable functions:
135135
* [Fast Adaptive Shrinkage/Thresholding Algorithm (FASTA)](#fast-adaptive-shrinkage-thresholding-algorithm-fasta) (`ens::FASTA`)
136136
* [FrankWolfe](#frank-wolfe) (`ens::FrankWolfe`)
137137
* [GradientDescent](#gradient-descent) (`ens::GradientDescent`)
138+
* [DeltaBarDelta](#delta-bar-delta) (`ens::DeltaBarDelta`)
138139
- Any optimizer for [arbitrary functions](#arbitrary-functions)
139140

140141
Each of these optimizers has an `Optimize()` function that is called as

doc/optimizers.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,64 @@ optimizer.Optimize(f, coordinates);
12851285
* [Differential Evolution in Wikipedia](https://en.wikipedia.org/wiki/Differential_Evolution)
12861286
* [Arbitrary functions](#arbitrary-functions)
12871287

1288+
## DeltaBarDelta
1289+
1290+
*An optimizer for [differentiable functions](#differentiable-functions).*
1291+
1292+
Gradient Descent is a technique to minimize a function. This is a Gradient
1293+
Descent variant that adapts learning rates for each parameter for better
1294+
convergence rates. DeltaBarDelta adjusts a weight’s learning rate by increasing
1295+
it by a fixed amount when the current slope aligns with the exponential average
1296+
of past slopes, and decreasing it by a proportion when it opposes them.
1297+
1298+
#### Constructors
1299+
1300+
* `DeltaBarDelta()`
1301+
* `DeltaBarDelta(`_`stepSize`_`)`
1302+
* `DeltaBarDelta(`_`stepSize, maxIterations, tolerance`_`)`
1303+
* `DeltaBarDelta(`_`stepSize, maxIterations, tolerance, updatePolicy, decayPolicy, resetPolicy`_`)`
1304+
1305+
Note that `DeltaBarDelta` is based on the templated type
1306+
`GradientDescentType<`_`UpdatePolicyType, DecayPolicyType`_`>` with _`UpdatePolicyType`_` =
1307+
`DeltaBarDeltaUpdate` and _`DecayPolicyType`_` = NoDecay`.
1308+
1309+
#### Attributes
1310+
1311+
| **type** | **name** | **description** | **default** |
1312+
|----------|----------|-----------------|-------------|
1313+
| `double` | **`stepSize`** | Step size for each iteration. | `0.01` |
1314+
| `size_t` | **`maxIterations`** | Maximum number of iterations allowed (0 means no limit). | `100000` |
1315+
| `size_t` | **`tolerance`** | Maximum absolute tolerance to terminate algorithm. | `1e-5` |
1316+
| `UpdatePolicyType` | **`updatePolicy`** | Instantiated update policy used to adjust the given parameters. | `UpdatePolicyType()` |
1317+
| `DecayPolicyType` | **`decayPolicy`** | Instantiated decay policy used to adjust the step size. | `DecayPolicyType()` |
1318+
| `bool` | **`resetPolicy`** | Flag that determines whether update policy parameters are reset before every Optimize call. | `true` |
1319+
1320+
Attributes of the optimizer may also be changed via the member methods
1321+
`StepSize()`, `MaxIterations()`, `Tolerance()`, `UpdatePolicy()`,
1322+
`DecayPolicy()`, and `ResetPolicy()`.
1323+
1324+
1325+
#### Examples:
1326+
1327+
<details open>
1328+
<summary>Click to collapse/expand example code.
1329+
</summary>
1330+
1331+
```c++
1332+
RosenbrockFunction f;
1333+
arma::mat coordinates = f.GetInitialPoint();
1334+
1335+
DeltaBarDelta optimizer(0.001, 0, 1e-15, DeltaBarDeltaUpdate(0.2, 0.8, 0.5, 0.01));
1336+
optimizer.Optimize(f, coordinates);
1337+
```
1338+
1339+
</details>
1340+
1341+
#### See also:
1342+
1343+
* [Increased rates of convergence through learning rate adaptation](https://www.academia.edu/download/32005051/Jacobs.NN88.pdf)
1344+
* [Differentiable functions](#differentiable-functions)
1345+
12881346
## DemonAdam
12891347
12901348
*An optimizer for [differentiable separable functions](#differentiable-separable-functions).*
@@ -1923,6 +1981,11 @@ negative of the gradient of the function at the current point.
19231981
* `GradientDescent()`
19241982
* `GradientDescent(`_`stepSize`_`)`
19251983
* `GradientDescent(`_`stepSize, maxIterations, tolerance`_`)`
1984+
* `GradientDescent(`_`stepSize, maxIterations, tolerance, updatePolicy, decayPolicy, resetPolicy`_`)`
1985+
1986+
Note that `GradientDescent` is based on the templated type
1987+
`GradientDescentType<`_`UpdatePolicyType, DecayPolicyType`_`>` with _`UpdatePolicyType`_` =
1988+
VanillaUpdate` and _`DecayPolicyType`_` = NoDecay`.
19261989

19271990
#### Attributes
19281991

@@ -1931,9 +1994,14 @@ negative of the gradient of the function at the current point.
19311994
| `double` | **`stepSize`** | Step size for each iteration. | `0.01` |
19321995
| `size_t` | **`maxIterations`** | Maximum number of iterations allowed (0 means no limit). | `100000` |
19331996
| `size_t` | **`tolerance`** | Maximum absolute tolerance to terminate algorithm. | `1e-5` |
1997+
| `UpdatePolicyType` | **`updatePolicy`** | Instantiated update policy used to adjust the given parameters. | `UpdatePolicyType()` |
1998+
| `DecayPolicyType` | **`decayPolicy`** | Instantiated decay policy used to adjust the step size. | `DecayPolicyType()` |
1999+
| `bool` | **`resetPolicy`** | Flag that determines whether update policy parameters are reset before every Optimize call. | `true` |
19342000

19352001
Attributes of the optimizer may also be changed via the member methods
1936-
`StepSize()`, `MaxIterations()`, and `Tolerance()`.
2002+
`StepSize()`, `MaxIterations()`, `Tolerance()`, `UpdatePolicy()`,
2003+
`DecayPolicy()`, and `ResetPolicy()`.
2004+
19372005

19382006
#### Examples:
19392007

0 commit comments

Comments
 (0)