mlpack
Public Member Functions | List of all members
mlpack::ann::Glimpse< InputDataType, OutputDataType > Class Template Reference

The glimpse layer returns a retina-like representation (down-scaled cropped images) of increasing scale around a given location in a given image. More...

#include <glimpse.hpp>

Public Member Functions

 Glimpse (const size_t inSize=0, const size_t size=0, const size_t depth=3, const size_t scale=2, const size_t inputWidth=0, const size_t inputHeight=0)
 Create the GlimpseLayer object using the specified ratio and rescale parameter. More...
 
template<typename eT >
void Forward (const arma::Mat< eT > &input, arma::Mat< eT > &output)
 Ordinary feed forward pass of the glimpse layer. More...
 
template<typename eT >
void Backward (const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
 Ordinary feed backward pass of the glimpse layer. More...
 
OutputDataType & OutputParameter () const
 Get the output parameter.
 
OutputDataType & OutputParameter ()
 Modify the output parameter.
 
OutputDataType & Delta () const
 Get the detla.
 
OutputDataType & Delta ()
 Modify the delta.
 
void Location (const arma::mat &location)
 Set the locationthe x and y coordinate of the center of the output glimpse. More...
 
size_t const & InputWidth () const
 Get the input width.
 
size_t & InputWidth ()
 Modify input the width.
 
size_t const & InputHeight () const
 Get the input height.
 
size_t & InputHeight ()
 Modify the input height.
 
size_t const & OutputWidth () const
 Get the output width.
 
size_t & OutputWidth ()
 Modify the output width.
 
size_t const & OutputHeight () const
 Get the output height.
 
size_t & OutputHeight ()
 Modify the output height.
 
bool Deterministic () const
 Get the value of the deterministic parameter.
 
bool & Deterministic ()
 Modify the value of the deterministic parameter.
 
size_t const & Depth () const
 Get the number of patches to crop per glimpse.
 
size_t const & Scale () const
 Get the scale fraction.
 
size_t InSize () const
 Get the size of the input units.
 
size_t GlimpseSize () const
 Get the used glimpse size (height = width).
 
size_t InputShape () const
 Get the shape of the input.
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the layer.
 

Detailed Description

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::Glimpse< InputDataType, OutputDataType >

The glimpse layer returns a retina-like representation (down-scaled cropped images) of increasing scale around a given location in a given image.

Template Parameters
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).

Constructor & Destructor Documentation

◆ Glimpse()

template<typename InputDataType , typename OutputDataType >
mlpack::ann::Glimpse< InputDataType, OutputDataType >::Glimpse ( const size_t  inSize = 0,
const size_t  size = 0,
const size_t  depth = 3,
const size_t  scale = 2,
const size_t  inputWidth = 0,
const size_t  inputHeight = 0 
)

Create the GlimpseLayer object using the specified ratio and rescale parameter.

Parameters
inSizeThe size of the input units.
sizeThe used glimpse size (height = width).
depthThe number of patches to crop per glimpse.
scaleThe scaling factor used to create the increasing retina-like representation.
inputWidthThe input width of the given input data.
inputHeightThe input height of the given input data.

Member Function Documentation

◆ Backward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::Glimpse< InputDataType, OutputDataType >::Backward ( const arma::Mat< eT > &  ,
const arma::Mat< eT > &  gy,
arma::Mat< eT > &  g 
)

Ordinary feed backward pass of the glimpse layer.

Parameters
*(input) The propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.

◆ Forward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::Glimpse< InputDataType, OutputDataType >::Forward ( const arma::Mat< eT > &  input,
arma::Mat< eT > &  output 
)

Ordinary feed forward pass of the glimpse layer.

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

◆ Location()

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
void mlpack::ann::Glimpse< InputDataType, OutputDataType >::Location ( const arma::mat &  location)
inline

Set the locationthe x and y coordinate of the center of the output glimpse.


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