RcppEnsmallen v0.2.15.0.1 Released - New Callback: Optimization Summary Report

software-releases
r
Author

TheCoatlessProfessor

Published

November 4, 2020

The RcppEnsmallen package brings to R a Header-Only C++ Mathematical Optimization Library for Armadillo. In particular, Ensmallen is a templated C++ mathematical optimization library (by the MLPACK team) that provides a simple set of abstractions for writing an objective function to optimize.

On election day in the United States, the Ensmallen Development Team made available a new version of Ensmallen with a killer new feature: Optimization Summary Reports. From the documentation, we have:

AdaDelta optimizer(1.0, 1, 0.99, 1e-8, 1000, 1e-9, true);

RosenbrockFunction f;
arma::mat coordinates = f.GetInitialPoint();
optimizer.Optimize(f, coordinates, Report(0.1));

Generating on completion:

Optimization Report
--------------------------------------------------------------------------------

Initial Coordinates:
  -1.2000   1.0000

Final coordinates:
  -1.0490   1.1070

iter          loss          loss change   |gradient|    step size     total time
0             24.2          0             233           1             4.27e-05
100           8.6           15.6          104           1             0.000215
200           5.26          3.35          48.7          1             0.000373
300           4.49          0.767         23.4          1             0.000533
400           4.31          0.181         11.3          1             0.000689
500           4.27          0.0431        5.4           1             0.000846
600           4.26          0.012         2.86          1             0.00101
700           4.25          0.00734       2.09          1             0.00117
800           4.24          0.00971       1.95          1             0.00132
900           4.22          0.0146        1.91          1             0.00148

--------------------------------------------------------------------------------

Version:
ensmallen:                    2.13.0 (Automatically Automated Automation)
armadillo:                    9.900.1 (Nocturnal Misbehaviour)

Function:
Number of functions:          1
Coordinates rows:             2
Coordinates columns:          1

Loss:
Initial                       24.2
Final                         4.2
Change                        20

Optimizer:
Maximum iterations:           1000
Reached maximum iterations:   true
Batchsize:                    1
Iterations:                   1000
Number of epochs:             1001
Initial step size:            1
Final step size:              1
Coordinates max. norm:        233
Evaluate calls:               1000
Gradient calls:               1000
Time (in seconds):            0.00163

We contributed an upstream fix to the header inclusion order alongside of adding date information to the release. Full change details can be found below in the news entry for the package update.

RcppEnsmallen news file entry for version v0.2.15.0.1 (2020-11-04)

  • Upgraded to ensmallen 2.15.0: “Why Can’t I Manage To Grow Any Plants?” (2020-11-03)
    • Make a few tests more robust (#228).
    • Add release date to version information. (#226)
    • Fix typo in release script (#236).
    • Add optimizer summary report callback (#213).
  • Fix header inclusion order

GitHub Changelog