GlimpseType< InputType, OutputType > 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...

Inheritance diagram for GlimpseType< InputType, OutputType >:

Public Member Functions

 GlimpseType (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...

 
void Backward (const InputType &, const OutputType &gy, OutputType &g)
 Ordinary feed backward pass of the glimpse layer. More...

 
size_t const & Depth () const
 Get the number of patches to crop per glimpse. More...

 
void Forward (const InputType &input, OutputType &output)
 Ordinary feed forward pass of the glimpse layer. More...

 
size_t GlimpseSize () const
 Get the used glimpse size (height = width). More...

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

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

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

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

 
size_t InSize () const
 Get the size of the input units. More...

 
void Location (const arma::mat &location)
 Set the locationthe x and y coordinate of the center of the output glimpse. More...

 
const std::vector< size_t > OutputDimensions () const
 
size_t const & OutputHeight () const
 Get the output height. More...

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

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

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

 
size_t const & Scale () const
 Get the scale fraction. More...

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

 
- Public Member Functions inherited from Layer< InputType, OutputType >
 Layer ()
 Default constructor. More...

 
 Layer (const Layer &layer)
 Copy constructor. This is not responsible for copying weights! More...

 
 Layer (Layer &&layer)
 Move constructor. This is not responsible for moving weights! More...

 
virtual ~Layer ()
 Default deconstructor. More...

 
virtual void Backward (const InputType &, const InputType &, InputType &)
 Performs a backpropagation step through the layer, with respect to the given input. More...

 
virtual LayerClone () const=0
 Make a copy of the object. More...

 
virtual void ComputeOutputDimensions ()
 Compute the output dimensions. More...

 
virtual void Forward (const InputType &, InputType &)
 Takes an input object, and computes the corresponding output of the layer. More...

 
virtual void Forward (const InputType &, const InputType &)
 Takes an input and output object, and computes the corresponding loss of the layer. More...

 
virtual void Gradient (const InputType &, const InputType &, InputType &)
 Computing the gradient of the layer with respect to its own input. More...

 
const std::vector< size_t > & InputDimensions () const
 Get the input dimensions. More...

 
std::vector< size_t > & InputDimensions ()
 Modify the input dimensions. More...

 
virtual double Loss ()
 Get the layer loss. More...

 
virtual Layeroperator= (const Layer &layer)
 Copy assignment operator. This is not responsible for copying weights! More...

 
virtual Layeroperator= (Layer &&layer)
 Move assignment operator. This is not responsible for moving weights! More...

 
const std::vector< size_t > & OutputDimensions ()
 Get the output dimensions. More...

 
virtual size_t OutputSize () final
 Get the number of elements in the output from this layer. More...

 
virtual const InputType & Parameters () const
 Get the parameters. More...

 
virtual InputType & Parameters ()
 Set the parameters. More...

 
void serialize (Archive &ar, const uint32_t)
 Serialize the layer. More...

 
virtual void SetWeights (typename InputType ::elem_type *)
 Reset the layer parameter. More...

 
virtual bool const & Training () const
 Get whether the layer is currently in training mode. More...

 
virtual bool & Training ()
 Modify whether the layer is currently in training mode. More...

 
virtual size_t WeightSize () const
 Get the total number of trainable weights in the layer. More...

 

Additional Inherited Members

- Protected Attributes inherited from Layer< InputType, OutputType >
std::vector< size_t > inputDimensions
 Logical input dimensions of each point. More...

 
std::vector< size_t > outputDimensions
 Logical output dimensions of each point. More...

 
bool training
 If true, the layer is in training mode; otherwise, it is in testing mode. More...

 
bool validOutputDimensions
 This is true if ComputeOutputDimensions() has been called, and outputDimensions can be considered to be up-to-date. More...

 

Detailed Description


template
<
typename
InputType
=
arma::mat
,
typename
OutputType
=
arma::mat
>

class mlpack::ann::GlimpseType< InputType, OutputType >

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
InputTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Definition at line 89 of file glimpse.hpp.

Constructor & Destructor Documentation

◆ GlimpseType()

GlimpseType ( 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()

void Backward ( const InputType &  ,
const OutputType &  gy,
OutputType &  g 
)

Ordinary feed backward pass of the glimpse layer.

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

◆ Depth()

size_t const& Depth ( ) const
inline

Get the number of patches to crop per glimpse.

Definition at line 155 of file glimpse.hpp.

◆ Forward()

void Forward ( const InputType &  input,
OutputType &  output 
)

Ordinary feed forward pass of the glimpse layer.

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

◆ GlimpseSize()

size_t GlimpseSize ( ) const
inline

Get the used glimpse size (height = width).

Definition at line 164 of file glimpse.hpp.

References core::v2::size().

◆ InputHeight() [1/2]

size_t const& InputHeight ( ) const
inline

Get the input height.

Definition at line 140 of file glimpse.hpp.

◆ InputHeight() [2/2]

size_t& InputHeight ( )
inline

Modify the input height.

Definition at line 142 of file glimpse.hpp.

◆ InputWidth() [1/2]

size_t const& InputWidth ( ) const
inline

Get the input width.

Definition at line 135 of file glimpse.hpp.

◆ InputWidth() [2/2]

size_t& InputWidth ( )
inline

Modify input the width.

Definition at line 137 of file glimpse.hpp.

◆ InSize()

size_t InSize ( ) const
inline

Get the size of the input units.

Definition at line 161 of file glimpse.hpp.

◆ Location()

void Location ( const arma::mat &  location)
inline

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

Definition at line 132 of file glimpse.hpp.

◆ OutputDimensions()

const std::vector<size_t> OutputDimensions ( ) const
inline

◆ OutputHeight() [1/2]

size_t const& OutputHeight ( ) const
inline

Get the output height.

Definition at line 150 of file glimpse.hpp.

◆ OutputHeight() [2/2]

size_t& OutputHeight ( )
inline

Modify the output height.

Definition at line 152 of file glimpse.hpp.

◆ OutputWidth() [1/2]

size_t const& OutputWidth ( ) const
inline

Get the output width.

Definition at line 145 of file glimpse.hpp.

◆ OutputWidth() [2/2]

size_t& OutputWidth ( )
inline

Modify the output width.

Definition at line 147 of file glimpse.hpp.

◆ Scale()

size_t const& Scale ( ) const
inline

Get the scale fraction.

Definition at line 158 of file glimpse.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

Serialize the layer.


The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-git/src/mlpack/methods/ann/layer/not_adapted/glimpse.hpp