The glimpse layer returns a retina-like representation (down-scaled cropped images) of increasing scale around a given location in a given image. More...
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... | |
![]() | |
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 Layer * | Clone () 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 Layer & | operator= (const Layer &layer) |
Copy assignment operator. This is not responsible for copying weights! More... | |
virtual Layer & | operator= (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 | |
![]() | |
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... | |
The glimpse layer returns a retina-like representation (down-scaled cropped images) of increasing scale around a given location in a given image.
InputType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 89 of file glimpse.hpp.
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.
inSize | The size of the input units. |
size | The used glimpse size (height = width). |
depth | The number of patches to crop per glimpse. |
scale | The scaling factor used to create the increasing retina-like representation. |
inputWidth | The input width of the given input data. |
inputHeight | The input height of the given input data. |
void Backward | ( | const InputType & | , |
const OutputType & | gy, | ||
OutputType & | g | ||
) |
Ordinary feed backward pass of the glimpse layer.
* | (input) The propagated input activation. |
gy | The backpropagated error. |
g | The calculated gradient. |
|
inline |
Get the number of patches to crop per glimpse.
Definition at line 155 of file glimpse.hpp.
void Forward | ( | const InputType & | input, |
OutputType & | output | ||
) |
Ordinary feed forward pass of the glimpse layer.
input | Input data used for evaluating the specified function. |
output | Resulting output activation. |
|
inline |
Get the used glimpse size (height = width).
Definition at line 164 of file glimpse.hpp.
References core::v2::size().
|
inline |
Get the input height.
Definition at line 140 of file glimpse.hpp.
|
inline |
Modify the input height.
Definition at line 142 of file glimpse.hpp.
|
inline |
Get the input width.
Definition at line 135 of file glimpse.hpp.
|
inline |
Modify input the width.
Definition at line 137 of file glimpse.hpp.
|
inline |
Get the size of the input units.
Definition at line 161 of file glimpse.hpp.
|
inline |
Set the locationthe x and y coordinate of the center of the output glimpse.
Definition at line 132 of file glimpse.hpp.
|
inline |
Definition at line 166 of file glimpse.hpp.
References core::v2::min(), MeanPoolingRule::Pooling(), core::v2::size(), and MeanPoolingRule::Unpooling().
|
inline |
Get the output height.
Definition at line 150 of file glimpse.hpp.
|
inline |
Modify the output height.
Definition at line 152 of file glimpse.hpp.
|
inline |
Get the output width.
Definition at line 145 of file glimpse.hpp.
|
inline |
Modify the output width.
Definition at line 147 of file glimpse.hpp.
|
inline |
Get the scale fraction.
Definition at line 158 of file glimpse.hpp.
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the layer.