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

#include <ebl_merge.h>

Inheritance diagram for ebl::flat_merge_module< T, Tstate >:
ebl::m2s_module< T, Tstate > ebl::module_1_1< T, Tin, Tout > ebl::module

List of all members.

Public Member Functions

 flat_merge_module (std::vector< Tstate ** > &inputs, idxdim &in, midxdim &ins, fidxdim &stride, mfidxdim &strides, const char *name_="flatmerge", const char *list=NULL)
 flat_merge_module (std::vector< mstate< Tstate > ** > &inputs, idxdim &in, midxdim &ins, fidxdim &stride, mfidxdim &strides, const char *name_="flatmerge", const char *list=NULL)
 flat_merge_module (midxdim &ins, mfidxdim &strides, bool pad=false, const char *name_="flatmerge", mfidxdim *scales=NULL, intg hextra=0, intg wextra=0, float ss=1, float edge=0)
virtual void fprop (Tstate &in, Tstate &out)
 forward propagation from in to out, using internal bufs for merging.
virtual void bprop (Tstate &in, Tstate &out)
 backward propagation from out to in, using internal bufs for merging.
virtual void bbprop (Tstate &in, Tstate &out)
 second-derivative backward propagation from out to in
virtual void fprop (mstate< Tstate > &in, Tstate &out)
 forward propagation from in to out
virtual void bprop (mstate< Tstate > &in, Tstate &out)
 backward propagation from out to in
virtual void bbprop (mstate< Tstate > &in, Tstate &out)
 second-derivative backward propagation from out to in
virtual idxdim fprop_size (idxdim &i_size)
virtual fidxdim bprop_size (const fidxdim &o_size)
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 uint get_ninputs ()
 Returns the number of expected inputs.
virtual mfidxdim get_strides ()
 Returns the strides for each input.
virtual mfidxdim get_scales ()
 Returns the scales for each input.
virtual flat_merge_module< T,
Tstate > * 
copy ()
 Returns a deep copy of current module.
virtual void set_offsets (vector< vector< int > > &off)
 Set offsets to be applied to each input scale.
virtual void set_strides (mfidxdim &s)
 Set strides.

Protected Member Functions

idxdim compute_pad (idxdim &window, float subsampling, float edge, float scale, fidxdim &stride)

Detailed Description

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

A module that flattens and concatenate multiple inputs. It takes one primary input to which inputs will be concatenated into the output (by allocating a bigger output and copying all data to that output).


Constructor & Destructor Documentation

template<typename T , class Tstate >
ebl::flat_merge_module< T, Tstate >::flat_merge_module ( std::vector< Tstate ** > &  inputs,
idxdim &  in,
midxdim &  ins,
fidxdim &  stride,
mfidxdim &  strides,
const char *  name_ = "flatmerge",
const char *  list = NULL 
)

Initialize inputs list.

Parameters:
inputsA vector of pointers to the input states pointers to concatenate.
template<typename T , class Tstate >
ebl::flat_merge_module< T, Tstate >::flat_merge_module ( std::vector< mstate< Tstate > ** > &  inputs,
idxdim &  in,
midxdim &  ins,
fidxdim &  stride,
mfidxdim &  strides,
const char *  name_ = "flatmerge",
const char *  list = NULL 
)

Initialize multi-state inputs list.

Parameters:
inputsA vector of pointers to the input states pointers to concatenate.
template<typename T , class Tstate >
ebl::flat_merge_module< T, Tstate >::flat_merge_module ( midxdim &  ins,
mfidxdim &  strides,
bool  pad = false,
const char *  name_ = "flatmerge",
mfidxdim *  scales = NULL,
intg  hextra = 0,
intg  wextra = 0,
float  ss = 1,
float  edge = 0 
)

Constructor for mstate inputs only. Buffers to be merge are not specified here, rather in fprop(mstate..). fprop(Tstate...) should not be used with this constructor.

Parameters:
padIf true, pad inputs so that windows are centered on edge pixels at image borders. This should be false during training and true during detection.

Member Function Documentation

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

template<typename T , class Tstate >
idxdim ebl::flat_merge_module< T, Tstate >::compute_pad ( idxdim &  window,
float  subsampling,
float  edge,
float  scale,
fidxdim &  stride 
) [protected]

Compute appropriate padding for current input in order to align all inputs, given current window of merging, subsampling ratio of this input w.r.t to image input, the edge or top-left coordinate of center of top-left pixel in image input (assuming square kernel), the scale of the input w.r.t to the original scale of the image, and finally the stride of this window. This returns the padding to apply to input.

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

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

Extract its dimensions, update output size


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