Implementation of the MultiplyMerge module class.
More...
#include <multiply_merge.hpp>
|
| MultiplyMerge (const bool model=false, const bool run=true) |
| Create the MultiplyMerge object using the specified parameters. More...
|
|
| MultiplyMerge (const MultiplyMerge &layer) |
| Copy Constructor.
|
|
| MultiplyMerge (MultiplyMerge &&layer) |
| Move Constructor.
|
|
MultiplyMerge & | operator= (const MultiplyMerge &layer) |
| Copy assignment operator.
|
|
MultiplyMerge & | operator= (MultiplyMerge &&layer) |
| Move assignment operator.
|
|
| ~MultiplyMerge () |
| Destructor to release allocated memory.
|
|
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 | 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...
|
|
template<typename eT > |
void | Gradient (const arma::Mat< eT > &input, const arma::Mat< eT > &error, arma::Mat< eT > &gradient) |
|
template<class LayerType , class... Args> |
void | Add (Args... args) |
|
void | Add (LayerTypes< CustomLayers... > layer) |
|
OutputDataType const & | OutputParameter () const |
| Get the output parameter.
|
|
OutputDataType & | OutputParameter () |
| Modify the output parameter.
|
|
OutputDataType const & | Delta () const |
| Get the delta.
|
|
OutputDataType & | Delta () |
| Modify the delta.
|
|
OutputDataType const & | Gradient () const |
| Get the gradient.
|
|
OutputDataType & | Gradient () |
| Modify the gradient.
|
|
std::vector< LayerTypes< CustomLayers... > > & | Model () |
| Return the model modules.
|
|
OutputDataType const & | Parameters () const |
| Get the parameters.
|
|
OutputDataType & | Parameters () |
| Modify the parameters.
|
|
size_t | WeightSize () const |
| Get the size of the weights.
|
|
template<typename Archive > |
void | serialize (Archive &ar, const uint32_t) |
| Serialize the layer.
|
|
template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat, typename... CustomLayers>
class mlpack::ann::MultiplyMerge< InputDataType, OutputDataType, CustomLayers >
Implementation of the MultiplyMerge module class.
The MultiplyMerge class multiplies the output of various modules element-wise.
- Template Parameters
-
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. |
◆ MultiplyMerge()
template<typename InputDataType , typename OutputDataType , typename... CustomLayers>
Create the MultiplyMerge object using the specified parameters.
- Parameters
-
model | Expose all the network modules. |
run | Call the Forward/Backward method before the output is merged. |
◆ Backward()
template<typename InputDataType , typename OutputDataType , typename... CustomLayers>
template<typename eT >
void mlpack::ann::MultiplyMerge< InputDataType, OutputDataType, CustomLayers >::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.
- Parameters
-
* | (input) The propagated input activation. |
gy | The backpropagated error. |
g | The calculated gradient. |
◆ Forward()
template<typename InputDataType , typename OutputDataType , typename... CustomLayers>
template<typename InputType , typename OutputType >
void mlpack::ann::MultiplyMerge< InputDataType, OutputDataType, CustomLayers >::Forward |
( |
const InputType & |
input, |
|
|
OutputType & |
output |
|
) |
| |
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.
- Parameters
-
* | (input) Input data used for evaluating the specified function. |
output | Resulting output activation. |
The documentation for this class was generated from the following files: