libeblearn
ebl::euclidean_module< T1, T2, Tstate1, Tstate2 > Class Template Reference

#include <ebl_cost.h>

Inheritance diagram for ebl::euclidean_module< T1, T2, Tstate1, Tstate2 >:
ebl::cost_module< T1, T2, Tstate1, Tstate2 > ebl::ebm_2< Tstate1, Tstate2, Tstate1 > ebl::module

List of all members.

Public Member Functions

 euclidean_module (idx< T1 > &targets_)
 constructor. targets are output targets to train toward.
virtual ~euclidean_module ()
 destructor.
virtual void fprop (Tstate1 &in1, Tstate2 &in2, Tstate1 &energy)
virtual void bprop (Tstate1 &in1, Tstate2 &in2, Tstate1 &energy)
virtual void bbprop (Tstate1 &in1, Tstate2 &in2, Tstate1 &energy)
virtual void forget (forget_param_linear &fp)
 TODO: implement?
virtual double infer2 (Tstate1 &i1, Tstate2 &i2, infer_param &ip, Tstate2 *label=NULL, Tstate1 *energy=NULL)
 compute value of in2 that minimizes the energy, given in1

Detailed Description

template<typename T1, typename T2, class Tstate1 = bbstate_idx<T1>, class Tstate2 = bbstate_idx<T2>>
class ebl::euclidean_module< T1, T2, Tstate1, Tstate2 >

A module with 2 inputs that computes 0.5 times the sum of square difference between the components of the inputs. The two inputs must be states of the same size.


Member Function Documentation

template<typename T1 , typename T2 , class Tstate1, class Tstate2>
void ebl::euclidean_module< T1, T2, Tstate1, Tstate2 >::bbprop ( Tstate1 &  in1,
Tstate2 &  in2,
Tstate1 &  energy 
) [virtual]

mse has this funny property that the bbprop method mixes up the the first derivative after with the second derivative before, and vice versa. Only the first combination is used here.

Reimplemented from ebl::ebm_2< Tstate1, Tstate2, Tstate1 >.

template<typename T1 , typename T2 , class Tstate1, class Tstate2>
void ebl::euclidean_module< T1, T2, Tstate1, Tstate2 >::bprop ( Tstate1 &  in1,
Tstate2 &  in2,
Tstate1 &  energy 
) [virtual]

Back-propagates gradients through <euclidean-module>. This multiplies the gradient of some function with respect to <energy> (stored in the <dx> slot of <energy>) by the jacobian of the <euclidean-module> with respect to its inputs. The result is written into the <dx> slots of <in1> and <in2>.

Reimplemented from ebl::ebm_2< Tstate1, Tstate2, Tstate1 >.

template<typename T1 , typename T2 , class Tstate1, class Tstate2>
void ebl::euclidean_module< T1, T2, Tstate1, Tstate2 >::fprop ( Tstate1 &  in1,
Tstate2 &  in2,
Tstate1 &  energy 
) [virtual]

Computes 0.5 times the sum of square difference between the components of state <in1> and the components of state <in2> (where a copy of the target corresponding to <label> is copied. Write the result into 0-dimensional state <energy>.

Reimplemented from ebl::ebm_2< Tstate1, Tstate2, Tstate1 >.


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