|
OpenNN
Open-source neural networks library
|
Workspace holding parameter gradients and per-layer deltas during a backward pass. More...
#include <back_propagation.h>
Public Member Functions | |
| BackPropagation (const Index=0, Loss *=nullptr) | |
| Constructs a workspace for the given batch size and loss. | |
| virtual | ~BackPropagation ()=default |
| void | set (const Index=0, Loss *=nullptr) |
| Reconfigures the workspace for a new batch size or loss; reuses allocations when possible. | |
| void | accumulate_output_deltas (size_t layer_index) |
| Accumulates deltas from all consumer edges into the given layer's output delta. | |
| TensorView & | get_output_delta () |
| Returns the output delta of the network (gradient w.r.t. the final outputs). | |
| const TensorView & | get_output_delta () const |
| Returns the output delta of the network (gradient w.r.t. the final outputs). | |
| void | print () const |
| Prints a human-readable summary of the workspace contents. | |
Public Attributes | |
| const NeuralNetwork * | neural_network = nullptr |
| Buffer | gradient |
| vector< vector< TensorView > > | gradient_views |
| Buffer | delta_pool |
| vector< vector< TensorView > > | delta_views |
| vector< vector< pair< size_t, size_t > > > | consumer_edges |
| Index | batch_size = 0 |
| Loss * | loss = nullptr |
| float | error = 0.0f |
| float | accuracy = 0.0f |
| float | loss_value = 0.0f |
| Index | active_tokens_count = 0 |
Workspace holding parameter gradients and per-layer deltas during a backward pass.
| opennn::BackPropagation::BackPropagation | ( | const Index | = 0, |
| Loss * | = nullptr ) |
Constructs a workspace for the given batch size and loss.
| batch_size | Maximum number of samples per backward pass. |
| loss | Loss object whose network drives buffer sizing (non-owning). |
|
virtualdefault |
| void opennn::BackPropagation::accumulate_output_deltas | ( | size_t | layer_index | ) |
Accumulates deltas from all consumer edges into the given layer's output delta.
| layer_index | Index of the layer whose output delta is being collected. |
| TensorView & opennn::BackPropagation::get_output_delta | ( | ) |
Returns the output delta of the network (gradient w.r.t. the final outputs).
| const TensorView & opennn::BackPropagation::get_output_delta | ( | ) | const |
Returns the output delta of the network (gradient w.r.t. the final outputs).
| void opennn::BackPropagation::print | ( | ) | const |
Prints a human-readable summary of the workspace contents.
| void opennn::BackPropagation::set | ( | const Index | = 0, |
| Loss * | = nullptr ) |
Reconfigures the workspace for a new batch size or loss; reuses allocations when possible.
| batch_size | Maximum number of samples per backward pass. |
| loss | Loss object whose network drives buffer sizing (non-owning). |
| float opennn::BackPropagation::accuracy = 0.0f |
| Index opennn::BackPropagation::active_tokens_count = 0 |
| Index opennn::BackPropagation::batch_size = 0 |
| vector<vector<pair<size_t, size_t> > > opennn::BackPropagation::consumer_edges |
| Buffer opennn::BackPropagation::delta_pool |
| vector<vector<TensorView> > opennn::BackPropagation::delta_views |
| float opennn::BackPropagation::error = 0.0f |
| Buffer opennn::BackPropagation::gradient |
| vector<vector<TensorView> > opennn::BackPropagation::gradient_views |
| Loss* opennn::BackPropagation::loss = nullptr |
| float opennn::BackPropagation::loss_value = 0.0f |
| const NeuralNetwork* opennn::BackPropagation::neural_network = nullptr |