Implementation of the MultiplyMerge module class. More...
Public Member Functions | |
MultiplyMerge (const bool model=false, const bool run=true) | |
Create the MultiplyMerge object using the specified parameters. More... | |
MultiplyMerge (const MultiplyMerge &layer) | |
Copy Constructor. More... | |
MultiplyMerge (MultiplyMerge &&layer) | |
Move Constructor. More... | |
~MultiplyMerge () | |
Destructor to release allocated memory. More... | |
template<class LayerType , class... Args> | |
void | Add (Args... args) |
void | Add (LayerTypes< CustomLayers... > layer) |
template < typename eT > | |
void | Backward (const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g) |
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards trough f, using the results from the feed forward pass. More... | |
OutputDataType const & | Delta () const |
Get the delta. More... | |
OutputDataType & | Delta () |
Modify the delta. More... | |
template < typename InputType , typename OutputType > | |
void | Forward (const InputType &, OutputType &output) |
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. More... | |
template < typename eT > | |
void | Gradient (const arma::Mat< eT > &input, const arma::Mat< eT > &error, arma::Mat< eT > &gradient) |
OutputDataType const & | Gradient () const |
Get the gradient. More... | |
OutputDataType & | Gradient () |
Modify the gradient. More... | |
std::vector< LayerTypes< CustomLayers... > > & | Model () |
Return the model modules. More... | |
MultiplyMerge & | operator= (const MultiplyMerge &layer) |
Copy assignment operator. More... | |
MultiplyMerge & | operator= (MultiplyMerge &&layer) |
Move assignment operator. More... | |
OutputDataType const & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
OutputDataType const & | Parameters () const |
Get the parameters. More... | |
OutputDataType & | Parameters () |
Modify the parameters. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the layer. More... | |
size_t | WeightSize () const |
Get the size of the weights. More... | |
Implementation of the MultiplyMerge module class.
The MultiplyMerge class multiplies the output of various modules element-wise.
InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
CustomLayers | Additional custom layers that can be added. |
Definition at line 211 of file layer_types.hpp.
MultiplyMerge | ( | const bool | model = false , |
const bool | run = true |
||
) |
Create the MultiplyMerge object using the specified parameters.
model | Expose all the network modules. |
run | Call the Forward/Backward method before the output is merged. |
MultiplyMerge | ( | const MultiplyMerge< InputDataType, OutputDataType, CustomLayers > & | layer | ) |
Copy Constructor.
MultiplyMerge | ( | MultiplyMerge< InputDataType, OutputDataType, CustomLayers > && | layer | ) |
Move Constructor.
~MultiplyMerge | ( | ) |
Destructor to release allocated memory.
|
inline |
Definition at line 110 of file multiply_merge.hpp.
|
inline |
Definition at line 117 of file multiply_merge.hpp.
void Backward | ( | const arma::Mat< eT > & | , |
const arma::Mat< eT > & | gy, | ||
arma::Mat< eT > & | g | ||
) |
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards trough f, using the results from the feed forward pass.
* | (input) The propagated input activation. |
gy | The backpropagated error. |
g | The calculated gradient. |
|
inline |
Get the delta.
Definition at line 125 of file multiply_merge.hpp.
|
inline |
Modify the delta.
Definition at line 127 of file multiply_merge.hpp.
void Forward | ( | const InputType & | , |
OutputType & | output | ||
) |
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.
* | (input) Input data used for evaluating the specified function. |
output | Resulting output activation. |
void Gradient | ( | const arma::Mat< eT > & | input, |
const arma::Mat< eT > & | error, | ||
arma::Mat< eT > & | gradient | ||
) |
|
inline |
Get the gradient.
Definition at line 130 of file multiply_merge.hpp.
|
inline |
Modify the gradient.
Definition at line 132 of file multiply_merge.hpp.
|
inline |
Return the model modules.
Definition at line 135 of file multiply_merge.hpp.
MultiplyMerge& operator= | ( | const MultiplyMerge< InputDataType, OutputDataType, CustomLayers > & | layer | ) |
Copy assignment operator.
MultiplyMerge& operator= | ( | MultiplyMerge< InputDataType, OutputDataType, CustomLayers > && | layer | ) |
Move assignment operator.
|
inline |
Get the output parameter.
Definition at line 120 of file multiply_merge.hpp.
|
inline |
Modify the output parameter.
Definition at line 122 of file multiply_merge.hpp.
|
inline |
Get the parameters.
Definition at line 146 of file multiply_merge.hpp.
|
inline |
Modify the parameters.
Definition at line 148 of file multiply_merge.hpp.
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the layer.
Referenced by MultiplyMerge< InputDataType, OutputDataType, CustomLayers >::WeightSize().
|
inline |
Get the size of the weights.
Definition at line 151 of file multiply_merge.hpp.
References MultiplyMerge< InputDataType, OutputDataType, CustomLayers >::serialize().