|
OpenNN
Open-source neural networks library
|
Scratch state used by LevenbergMarquardtAlgorithm. More...
#include <levenberg_marquardt_algorithm.h>
Public Member Functions | |
| BackPropagationLM (const Index samples_number=0, Loss *loss=nullptr) | |
| Constructs the scratch state. | |
| virtual | ~BackPropagationLM ()=default |
| Virtual destructor. | |
| void | set (const Index samples_number=0, Loss *loss=nullptr) |
| (Re)allocates buffers for the given dataset. | |
Public Attributes | |
| Index | samples_number = 0 |
| Number of samples this scratch is sized for. | |
| VectorR | output_deltas |
| Per-sample output deltas. | |
| Shape | output_delta_dimensions |
| Shape of output_deltas as a multi-dimensional view. | |
| Loss * | loss = nullptr |
| Loss to which this scratch is bound; not owned. | |
| float | error |
| Mean error over the batch. | |
| float | regularization = 0.0f |
| Regularization contribution to the loss. | |
| float | loss_value = 0.0f |
| Total loss = error + regularization. | |
| VectorR | errors |
| Per-sample residual errors. | |
| VectorR | squared_errors |
| Per-sample squared errors. | |
| MatrixR | squared_errors_jacobian |
| Jacobian of squared_errors with respect to the parameters. | |
| VectorR | gradient |
| Approximate gradient (J^T * e). | |
| MatrixR | hessian |
| Approximate Hessian (J^T * J + lambda * I). | |
Scratch state used by LevenbergMarquardtAlgorithm.
Holds per-sample errors and squared errors, the Jacobian of the squared errors with respect to parameters, and the resulting approximate gradient and Hessian used by the LM update.
| opennn::BackPropagationLM::BackPropagationLM | ( | const Index | samples_number = 0, |
| Loss * | loss = nullptr ) |
Constructs the scratch state.
| samples_number | Number of samples that will be processed. |
| loss | Loss to which the state is bound. |
|
virtualdefault |
Virtual destructor.
| void opennn::BackPropagationLM::set | ( | const Index | samples_number = 0, |
| Loss * | loss = nullptr ) |
(Re)allocates buffers for the given dataset.
| samples_number | Number of samples to allocate for. |
| loss | Loss to bind. |
| float opennn::BackPropagationLM::error |
Mean error over the batch.
| VectorR opennn::BackPropagationLM::errors |
Per-sample residual errors.
| VectorR opennn::BackPropagationLM::gradient |
Approximate gradient (J^T * e).
| MatrixR opennn::BackPropagationLM::hessian |
Approximate Hessian (J^T * J + lambda * I).
| float opennn::BackPropagationLM::loss_value = 0.0f |
Total loss = error + regularization.
| Shape opennn::BackPropagationLM::output_delta_dimensions |
Shape of output_deltas as a multi-dimensional view.
| VectorR opennn::BackPropagationLM::output_deltas |
Per-sample output deltas.
| float opennn::BackPropagationLM::regularization = 0.0f |
Regularization contribution to the loss.
| Index opennn::BackPropagationLM::samples_number = 0 |
Number of samples this scratch is sized for.
| VectorR opennn::BackPropagationLM::squared_errors |
Per-sample squared errors.
| MatrixR opennn::BackPropagationLM::squared_errors_jacobian |
Jacobian of squared_errors with respect to the parameters.