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

#include <ebl_pooling.h>

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

List of all members.

Public Member Functions

 subsampling_module (parameter< T, Tstate > *p, uint thickness, idxdim &kernel, idxdim &stride, const char *name="subsampling", bool crop=true, bool pad=true)
virtual ~subsampling_module ()
 destructor
virtual void fprop (Tstate &in, Tstate &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 void forget (forget_param_linear &fp)
 forgetting weights by replacing with random values
virtual int replicable_order ()
 order of operation
virtual bool resize_output (Tstate &in, Tstate &out)
 resize the output based on input dimensions
virtual fidxdim fprop_size (fidxdim &i_size)
virtual fidxdim bprop_size (const fidxdim &o_size)
virtual subsampling_module< T,
Tstate > * 
copy ()
 Returns a deep copy of this module.
virtual std::string describe ()
 Returns a string describing this module and its parameters.
virtual void dump_fprop (Tstate &in, Tstate &out)

Public Attributes

Tstate coeff
 Learned averaging coefficients.
Tstate sub
 Temporary buffer to hold sum of neighborhood.
uint thickness
 Number of features.
idxdim kernel
 Dimensions of subsampling kernel.
idxdim stride
 Strides of subsampling.

Protected Attributes

bool crop
 Crop input when size mismatch or not.
bool pad
 Pad output when size mismatch or not.

Detailed Description

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

This module applies 2D subsampling on dimensions 1 and 2 (0 contains different layers of information). This module has a replicable order of 3, if the input has a bigger order, use the replicable version of this module: subsampling_module_replicable.


Constructor & Destructor Documentation

template<typename T , class Tstate >
ebl::subsampling_module< T, Tstate >::subsampling_module ( parameter< T, Tstate > *  p,
uint  thickness,
idxdim &  kernel,
idxdim &  stride,
const char *  name = "subsampling",
bool  crop = true,
bool  pad = true 
)

Constructor.

Parameters:
pis used to store all parametric variables in a single place. If p is null, a local buffer will be used.
thicknessThe number of features.
kernelSize of subsampling kernel (without thickness).
strideStride of subsampling kernel (without thickness).
cropIf true, crop input when it does not match with the kernel. This allows to feed any input size to this module.
padIf true, add padding to end of non-feature dimensions to match the kernel when not matching.

Member Function Documentation

template<typename T , class Tstate >
fidxdim ebl::subsampling_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.

Just multiply each dimension by its stride

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

template<typename T , class Tstate >
void ebl::subsampling_module< T, Tstate >::dump_fprop ( Tstate &  in,
Tstate &  out 
) [virtual]

Calls fprop and then dumps internal buffers, inputs and outputs into files. This can be useful for debugging.

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

template<typename T , class Tstate >
fidxdim ebl::subsampling_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 >.


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