OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
opennn::ForwardPropagation Struct Reference

Workspace holding the activations of every layer during a forward pass. More...

#include <forward_propagation.h>

Public Member Functions

 ForwardPropagation (const Index=0, NeuralNetwork *=nullptr)
 Constructs a workspace for the given batch size and network.
 
void set (const Index=0, NeuralNetwork *=nullptr)
 Reconfigures the workspace for a new batch size or network; reuses allocations when possible.
 
TensorView get_last_trainable_layer_outputs () const
 Returns the output tensor of the last trainable layer.
 
TensorView get_outputs () const
 Returns the final output tensor of the network.
 
void print () const
 Prints a human-readable summary of the workspace contents.
 

Public Attributes

Index batch_size = 0
 
NeuralNetworkneural_network = nullptr
 
Buffer data
 
vector< vector< vector< TensorView > > > views
 

Detailed Description

Workspace holding the activations of every layer during a forward pass.

Constructor & Destructor Documentation

◆ ForwardPropagation()

opennn::ForwardPropagation::ForwardPropagation ( const Index = 0,
NeuralNetwork * = nullptr )

Constructs a workspace for the given batch size and network.

Parameters
batch_sizeMaximum number of samples per forward pass.
neural_networkNetwork whose layer specs drive buffer sizing (non-owning).

Member Function Documentation

◆ get_last_trainable_layer_outputs()

TensorView opennn::ForwardPropagation::get_last_trainable_layer_outputs ( ) const

Returns the output tensor of the last trainable layer.

◆ get_outputs()

TensorView opennn::ForwardPropagation::get_outputs ( ) const

Returns the final output tensor of the network.

◆ print()

void opennn::ForwardPropagation::print ( ) const

Prints a human-readable summary of the workspace contents.

◆ set()

void opennn::ForwardPropagation::set ( const Index = 0,
NeuralNetwork * = nullptr )

Reconfigures the workspace for a new batch size or network; reuses allocations when possible.

Parameters
batch_sizeMaximum number of samples per forward pass.
neural_networkNetwork whose layer specs drive buffer sizing (non-owning).

Member Data Documentation

◆ batch_size

Index opennn::ForwardPropagation::batch_size = 0

◆ data

Buffer opennn::ForwardPropagation::data

◆ neural_network

NeuralNetwork* opennn::ForwardPropagation::neural_network = nullptr

◆ views

vector<vector<vector<TensorView> > > opennn::ForwardPropagation::views