TransposedConvolution< ForwardConvolutionRule, BackwardConvolutionRule, GradientConvolutionRule, InputDataType, OutputDataType > Class Template Reference

Implementation of the Transposed Convolution class. More...

Public Member Functions

 TransposedConvolution ()
 Create the Transposed Convolution object. More...

 
 TransposedConvolution (const size_t inSize, const size_t outSize, const size_t kW, const size_t kH, const size_t dW=1, const size_t dH=1, const size_t padW=0, const size_t padH=0, const size_t inputWidth=0, const size_t inputHeight=0)
 Create the Transposed Convolution object using the specified number of input maps, output maps, filter size, stride and padding parameter. More...

 
template
<
typename
eT
>
void Backward (const arma::Mat< eT > &&, 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 through f. More...

 
arma::mat & Bias ()
 Modify the bias weights of the layer. More...

 
OutputDataType const & Delta () const
 Get the delta. More...

 
OutputDataType & Delta ()
 Modify the delta. More...

 
template
<
typename
eT
>
void Forward (const arma::Mat< eT > &&input, arma::Mat< eT > &&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 > &&, arma::Mat< eT > &&error, arma::Mat< eT > &&gradient)
 
OutputDataType const & Gradient () const
 Get the gradient. More...

 
OutputDataType & Gradient ()
 Modify the gradient. More...

 
size_t const & InputHeight () const
 Get the input height. More...

 
size_t & InputHeight ()
 Modify the input height. More...

 
InputDataType const & InputParameter () const
 Get the input parameter. More...

 
InputDataType & InputParameter ()
 Modify the input parameter. More...

 
size_t const & InputWidth () const
 Get the input width. More...

 
size_t & InputWidth ()
 Modify input the width. More...

 
size_t const & OutputHeight () const
 Get the output height. More...

 
size_t & OutputHeight ()
 Modify the output height. More...

 
OutputDataType const & OutputParameter () const
 Get the output parameter. More...

 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...

 
size_t const & OutputWidth () const
 Get the output width. More...

 
size_t & OutputWidth ()
 Modify the output width. More...

 
OutputDataType const & Parameters () const
 Get the parameters. More...

 
OutputDataType & Parameters ()
 Modify the parameters. More...

 
void Reset ()
 
template
<
typename
Archive
>
void serialize (Archive &ar, const unsigned int)
 Serialize the layer. More...

 

Detailed Description


template<typename ForwardConvolutionRule = NaiveConvolution<ValidConvolution>, typename BackwardConvolutionRule = NaiveConvolution<FullConvolution>, typename GradientConvolutionRule = NaiveConvolution<ValidConvolution>, typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::TransposedConvolution< ForwardConvolutionRule, BackwardConvolutionRule, GradientConvolutionRule, InputDataType, OutputDataType >

Implementation of the Transposed Convolution class.

The Transposed Convolution class represents a single layer of a neural network.

Template Parameters
ForwardConvolutionRuleConvolution to perform forward process.
BackwardConvolutionRuleConvolution to perform backward process.
GradientConvolutionRuleConvolution to calculate gradient.
InputDataTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputDataTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Definition at line 149 of file layer_types.hpp.

Constructor & Destructor Documentation

◆ TransposedConvolution() [1/2]

Create the Transposed Convolution object.

◆ TransposedConvolution() [2/2]

TransposedConvolution ( const size_t  inSize,
const size_t  outSize,
const size_t  kW,
const size_t  kH,
const size_t  dW = 1,
const size_t  dH = 1,
const size_t  padW = 0,
const size_t  padH = 0,
const size_t  inputWidth = 0,
const size_t  inputHeight = 0 
)

Create the Transposed Convolution object using the specified number of input maps, output maps, filter size, stride and padding parameter.

Parameters
inSizeThe number of input maps.
outSizeThe number of output maps.
kWWidth of the filter/kernel.
kHHeight of the filter/kernel.
dWStride of filter application in the x direction.
dHStride of filter application in the y direction.
padWPadding width of the input.
padHPadding height of the input.
inputWidthThe width of the input data.
inputHeightThe height of the input data.

Member Function Documentation

◆ Backward()

void Backward ( const arma::Mat< eT > &&  ,
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 through f.

Using the results from the feed forward pass.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.

◆ Bias()

◆ Delta() [1/2]

OutputDataType const& Delta ( ) const
inline

Get the delta.

Definition at line 137 of file transposed_convolution.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 139 of file transposed_convolution.hpp.

◆ Forward()

void Forward ( const arma::Mat< eT > &&  input,
arma::Mat< eT > &&  output 
)

Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.

◆ Gradient() [1/3]

void Gradient ( const arma::Mat< eT > &&  ,
arma::Mat< eT > &&  error,
arma::Mat< eT > &&  gradient 
)

◆ Gradient() [2/3]

OutputDataType const& Gradient ( ) const
inline

Get the gradient.

Definition at line 142 of file transposed_convolution.hpp.

◆ Gradient() [3/3]

OutputDataType& Gradient ( )
inline

Modify the gradient.

Definition at line 144 of file transposed_convolution.hpp.

◆ InputHeight() [1/2]

size_t const& InputHeight ( ) const
inline

Get the input height.

Definition at line 152 of file transposed_convolution.hpp.

◆ InputHeight() [2/2]

size_t& InputHeight ( )
inline

Modify the input height.

Definition at line 154 of file transposed_convolution.hpp.

◆ InputParameter() [1/2]

InputDataType const& InputParameter ( ) const
inline

Get the input parameter.

Definition at line 127 of file transposed_convolution.hpp.

◆ InputParameter() [2/2]

InputDataType& InputParameter ( )
inline

Modify the input parameter.

Definition at line 129 of file transposed_convolution.hpp.

◆ InputWidth() [1/2]

size_t const& InputWidth ( ) const
inline

Get the input width.

Definition at line 147 of file transposed_convolution.hpp.

◆ InputWidth() [2/2]

size_t& InputWidth ( )
inline

Modify input the width.

Definition at line 149 of file transposed_convolution.hpp.

◆ OutputHeight() [1/2]

size_t const& OutputHeight ( ) const
inline

Get the output height.

Definition at line 162 of file transposed_convolution.hpp.

◆ OutputHeight() [2/2]

size_t& OutputHeight ( )
inline

Modify the output height.

Definition at line 164 of file transposed_convolution.hpp.

◆ OutputParameter() [1/2]

OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 132 of file transposed_convolution.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 134 of file transposed_convolution.hpp.

◆ OutputWidth() [1/2]

size_t const& OutputWidth ( ) const
inline

Get the output width.

Definition at line 157 of file transposed_convolution.hpp.

◆ OutputWidth() [2/2]

size_t& OutputWidth ( )
inline

Modify the output width.

Definition at line 159 of file transposed_convolution.hpp.

◆ Parameters() [1/2]

OutputDataType const& Parameters ( ) const
inline

Get the parameters.

Definition at line 122 of file transposed_convolution.hpp.

◆ Parameters() [2/2]

OutputDataType& Parameters ( )
inline

Modify the parameters.

Definition at line 124 of file transposed_convolution.hpp.

◆ Reset()

void Reset ( )

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

The documentation for this class was generated from the following files: