n2p2 - A neural network potential package
|
Base class for different weight update methods. More...
#include <Updater.h>
Public Member Functions | |
virtual void | setState (double *state)=0 |
Set pointer to current state. More... | |
virtual void | setError (double const *const error, std::size_t const size=1)=0 |
Set pointer to current error vector. More... | |
virtual void | setJacobian (double const *const jacobian, std::size_t const columns=1)=0 |
Set pointer to current Jacobi matrix. More... | |
virtual void | update ()=0 |
Perform single update of state vector. More... | |
virtual std::string | status (std::size_t epoch) const =0 |
Status report. More... | |
virtual std::vector< std::string > | statusHeader () const =0 |
Header for status report file. More... | |
virtual std::vector< std::string > | info () const =0 |
Information about this updater. More... | |
virtual void | setupTiming (std::string const &prefix="upd") |
Activate detailed timing. More... | |
virtual void | resetTimingLoop () |
Start a new timing loop (e.g. More... | |
virtual std::map< std::string, Stopwatch > | getTiming () const |
Return timings gathered in stopwatch map. More... | |
Protected Member Functions | |
Updater (std::size_t const sizeState) | |
Constructor. More... | |
Protected Attributes | |
bool | timing |
Whether detailed timing is enabled. More... | |
bool | timingReset |
Internal loop timer reset switch. More... | |
std::size_t | sizeState |
Number of neural network connections (weights + biases). More... | |
std::string | prefix |
Prefix for timing stopwatches. More... | |
std::map< std::string, Stopwatch > | sw |
Stopwatch map for timing. More... | |
|
protected |
Constructor.
[in] | sizeState | Size of the state vector (number of parameters to optimize). |
Definition at line 22 of file Updater.cpp.
|
pure virtual |
Set pointer to current state.
[in,out] | state | Pointer to state vector (weights vector), will be changed in-place upon calling update(). |
Implemented in nnp::GradientDescent, and nnp::KalmanFilter.
|
pure virtual |
Set pointer to current error vector.
[in] | error | Pointer to error (difference between reference and neural network potential output). |
[in] | size | Number of error vector entries. |
Implemented in nnp::KalmanFilter, and nnp::GradientDescent.
|
pure virtual |
Set pointer to current Jacobi matrix.
[in] | jacobian | Derivatives of error with respect to weights. |
[in] | columns | Number of gradients provided. |
Implemented in nnp::KalmanFilter, and nnp::GradientDescent.
|
pure virtual |
Perform single update of state vector.
Implemented in nnp::GradientDescent, and nnp::KalmanFilter.
|
pure virtual |
Status report.
[in] | epoch | Current epoch. |
Implemented in nnp::GradientDescent, and nnp::KalmanFilter.
|
pure virtual |
Header for status report file.
Implemented in nnp::GradientDescent, and nnp::KalmanFilter.
|
pure virtual |
Information about this updater.
Implemented in nnp::GradientDescent, and nnp::KalmanFilter.
|
virtual |
|
virtual |
Start a new timing loop (e.g.
epoch).
Definition at line 42 of file Updater.cpp.
References timingReset.
|
virtual |
Return timings gathered in stopwatch map.
Definition at line 37 of file Updater.cpp.
References sw.
|
protected |
Whether detailed timing is enabled.
Definition at line 106 of file Updater.h.
Referenced by setupTiming().
|
protected |
Internal loop timer reset switch.
Definition at line 108 of file Updater.h.
Referenced by resetTimingLoop().
|
protected |
Number of neural network connections (weights + biases).
Definition at line 110 of file Updater.h.
Referenced by nnp::GradientDescent::GradientDescent(), nnp::GradientDescent::info(), nnp::KalmanFilter::info(), nnp::KalmanFilter::KalmanFilter(), nnp::KalmanFilter::setState(), nnp::GradientDescent::status(), nnp::KalmanFilter::status(), and nnp::GradientDescent::update().
|
protected |
Prefix for timing stopwatches.
Definition at line 112 of file Updater.h.
Referenced by setupTiming().
|
protected |