libeblearn
ebl::zpad_module< T, Tstate > Class Template Reference

#include <ebl_basic.h>

Inheritance diagram for ebl::zpad_module< T, Tstate >:
ebl::module_1_1< T, Tstate > ebl::module ebl::mirrorpad_module< T, Tstate >

List of all members.

Public Member Functions

 zpad_module (const char *name="zpad")
 zpad_module (int nrows, int ncolumns)
 zpad_module (int top, int left, int bottom, int right)
 zpad_module (idxdim &kernel_size, const char *name="zpad")
 zpad_module (midxdim &kernels, const char *name="zpad")
virtual ~zpad_module ()
 destructor
virtual void fprop (mstate< Tstate > &in, mstate< Tstate > &out)
virtual void fprop (Tstate &in, Tstate &out)
 forward propagation from in to out
virtual void fprop (Tstate &in, idx< T > &out)
 forward propagation from in to out
virtual void fprop (idx< T > &in, idx< T > &out)
 forward propagation from in to out
virtual void bprop (Tstate &in, Tstate &out)
 backward propagation from out to in
virtual void bbprop (Tstate &in, Tstate &out)
 second-derivative backward propagation from out to in
virtual idxdim get_paddings ()
 Return all paddings in an idxdim: top,left,bottom,right.
virtual idxdim get_paddings (idxdim &kernel)
virtual midxdim get_paddings (midxdim &kernels)
virtual void set_paddings (int top, int left, int bottom, int right)
 Set all paddings for top, left, bottom and right sides.
virtual void set_paddings (idxdim &pads)
 Set all paddings from 'pads' in this order: top,left,bottom,right.
virtual void set_kernel (idxdim &kernel)
 Set all paddings according to 'kernel'.
virtual void set_kernels (midxdim &kernels)
 Set all paddings according to 'kernels' for multi-state inputs.
virtual fidxdim fprop_size (fidxdim &i_size)
virtual fidxdim bprop_size (const fidxdim &o_size)
virtual mfidxdim fprop_size (mfidxdim &isize)
 Returns multiple input dimensions corresponding to output dims 'osize'.
virtual mfidxdim bprop_size (mfidxdim &osize)
 Returns multiple input dimensions corresponding to output dims 'osize'.
virtual std::string describe ()
 Returns a string describing this module and its parameters.
virtual zpad_module< T, Tstate > * copy (parameter< T, Tstate > *p=NULL)

Protected Attributes

idxdim pad
 Current padding (top,left,bottom,right).
midxdim pads
 Paddings (top,left,bottom,right) for all scales.

Detailed Description

template<typename T, class Tstate = bbstate_idx<T>>
class ebl::zpad_module< T, Tstate >

a simple zero padding module that is mostly usefull for doing same size output convolutions.


Constructor & Destructor Documentation

template<typename T , class Tstate >
ebl::zpad_module< T, Tstate >::zpad_module ( const char *  name = "zpad")

Empty constructor. User should set paddings via the set_paddings() method.

template<typename T , class Tstate >
ebl::zpad_module< T, Tstate >::zpad_module ( int  nrows,
int  ncolumns 
)

Constructs a zpad that adds same size borders on each side.

Parameters:
nrowsThe number of rows added on each side.
ncolumnsThe number of cols added on each side. the output size is enlarged by 2*nrow in rows and 2*ncols in cols for each feature map.
template<typename T , class Tstate >
ebl::zpad_module< T, Tstate >::zpad_module ( int  top,
int  left,
int  bottom,
int  right 
)

Constructs a zpad module that adds padding on each side of a 2D input. (the 1st (features) dimension is left unchanged).

Parameters:
topThe number of rows added on to the top side.
leftThe number of rows added on to the left side.
bottomThe number of rows added on to the bottom side.
rightThe number of rows added on to the right side.
template<typename T , class Tstate >
ebl::zpad_module< T, Tstate >::zpad_module ( idxdim &  kernel_size,
const char *  name = "zpad" 
)

Constructor adding zero borders with same size on each size if the kernel had odd size, otherwise adding 1 pixel less on the right and bottom borders.

Parameters:
kernel_sizeThe sizes of the kernel for which to pad.
template<typename T , class Tstate >
ebl::zpad_module< T, Tstate >::zpad_module ( midxdim &  kernels,
const char *  name = "zpad" 
)

Constructor adding zero borders with same size on each size if the kernel had odd size, otherwise adding 1 pixel less on the right and bottom borders.

Parameters:
kernelsA kernel for each input in case of multi-state input.

Member Function Documentation

template<typename T , class Tstate >
fidxdim ebl::zpad_module< T, Tstate >::bprop_size ( const fidxdim &  o_size) [virtual]

Return dimensions compatible with this module given output dimensions. See module_1_1_gen's documentation for more details.

Reimplemented from ebl::module_1_1< T, Tstate >.

template<typename T , class Tstate >
zpad_module< T, Tstate > * ebl::zpad_module< T, Tstate >::copy ( parameter< T, Tstate > *  p = NULL) [virtual]

Returns a deep copy of this module.

Parameters:
pIf NULL, reuse current parameter space, otherwise allocate new weights on parameter 'p'.

Reimplemented from ebl::module_1_1< T, Tstate >.

Reimplemented in ebl::mirrorpad_module< T, Tstate >.

template<typename T , class Tstate >
fidxdim ebl::zpad_module< T, Tstate >::fprop_size ( fidxdim &  i_size) [virtual]

Return dimensions that are compatible with this module. See module_1_1_gen's documentation for more details.

Recompute the input size to be compliant with the output

Reimplemented from ebl::module_1_1< T, Tstate >.

template<typename T , class Tstate >
idxdim ebl::zpad_module< T, Tstate >::get_paddings ( idxdim &  kernel) [virtual]

Returns all paddings associated with a 'kernel': top,left,bottom,right. This does not set any internal parameters of this module.

template<typename T , class Tstate >
midxdim ebl::zpad_module< T, Tstate >::get_paddings ( midxdim &  kernels) [virtual]

Returns all paddings associated with a 'kernel': top,left,bottom,right. This does not set any internal parameters of this module.


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