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

#include <ebl_normalization.h>

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

List of all members.

Public Member Functions

 divisive_norm_module (idxdim &kerdim, int nf, bool mirror=false, bool threshold=true, parameter< T, Tstate > *p=NULL, const char *name="divisive_norm", bool across_features=true, double cgauss=2.0, bool fsum_div=false, float fsum_split=1.0, double epsilon=1e-6)
virtual ~divisive_norm_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 dump_fprop (Tstate &in, Tstate &out)
virtual divisive_norm_module
< T, Tstate > * 
copy (parameter< T, Tstate > *p=NULL)
virtual bool optimize_fprop (Tstate &in, Tstate &out)
virtual std::string describe ()
 Returns a string describing this module and its parameters.

Public Attributes

bool mirror
 mirror input or not.

Protected Attributes

parameter< T, Tstate > * param
layers< T, Tstate > convvar
power_module< T, Tstate > sqrtmod
 square root module
power_module< T, Tstate > invmod
 inverse module
power_module< T, Tstate > sqmod
 square module
thres_module< T, Tstate > thres
 threshold module
mul_module< T, Tstate > mcw
convolution_module< T, Tstate > * divconv
module_1_1< T, Tstate > * padding
idx< T > w
 weights
Tstate insq
Tstate invar
Tstate instd
Tstate thstd
Tstate invstd
bool threshold
int nfeatures
idxdim kerdim
bool across_features
 Norm across feats.
double epsilon
 bias to avoid div by 0.

Friends

class divisive_norm_module_gui
class contrast_norm_module_gui
class contrast_norm_module

Detailed Description

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

This module divides local neighborhoods by they standard deviation.


Constructor & Destructor Documentation

template<typename T , class Tstate >
ebl::divisive_norm_module< T, Tstate >::divisive_norm_module ( idxdim &  kerdim,
int  nf,
bool  mirror = false,
bool  threshold = true,
parameter< T, Tstate > *  p = NULL,
const char *  name = "divisive_norm",
bool  across_features = true,
double  cgauss = 2.0,
bool  fsum_div = false,
float  fsum_split = 1.0,
double  epsilon = 1e-6 
)
Parameters:
kerdimThe neighborhood dimensions.
nfThe number of feature maps input to this module.
mirrorUse mirroring of the input to pad border if true, or use zero-padding otherwise (default).
pIf specified, parameter p holds learned weights.
across_featuresIf true, normalize across feature dimensions in addition to spatial dimensions.
cgaussGaussian kernel coefficient.

normalize the kernel

feature sum module to sum along features this might be implemented by making the table in above conv module all to all connection, but that would be very inefficient


Member Function Documentation

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

second-derivative backward propagation from out to in

out = in/std

1/std

std(std<mean(std)) = mean(std)

sqrt(sum_j (w_j in^2))

sum_j (w_j in^2)

in^2

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

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

backward propagation from out to in

clear derivatives

out = in/std

1/std

std(std<mean(std)) = mean(std)

sqrt(sum_j (w_j in^2))

sum_j (w_j in^2)

in^2

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

template<typename T , class Tstate >
divisive_norm_module< T, Tstate > * ebl::divisive_norm_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 >.

template<typename T , class Tstate >
void ebl::divisive_norm_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 >
void ebl::divisive_norm_module< T, Tstate >::fprop ( Tstate &  in,
Tstate &  out 
) [virtual]

forward propagation from in to out

insq = in^2 TODO: would this be faster with idx_mul(in, in, insq)?

invar = sum_j (w_j in^2)

instd = sqrt(sum_j (w_j in^2))

update the threshold values in thres

std(std<mean(std)) = mean(std)

invstd = 1 / thstd

out = in / thstd

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

template<typename T , class Tstate >
bool ebl::divisive_norm_module< T, Tstate >::optimize_fprop ( Tstate &  in,
Tstate &  out 
) [virtual]

Pre-determine the order of hidden buffers to use only 2 buffers in order to reduce memory footprint. This returns true if outputs is actually put in out, false if it's in in.

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


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