Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::TangentLearner Class Reference

#include <TangentLearner.h>

Inheritance diagram for PLearn::TangentLearner:

Inheritance graph
[legend]
Collaboration diagram for PLearn::TangentLearner:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TangentLearner ()
 Default constructor.

virtual void build ()
 Simply calls inherited::build() then build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (TangentLearner)
virtual int outputsize () const
 Returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options).

virtual void forget ()
 (Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!).

virtual void initializeParams ()
virtual void train ()
 The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process.

virtual void computeOutput (const Vec &input, Vec &output) const
 Computes the output from the input.

virtual void computeCostsFromOutputs (const Vec &input, const Vec &output, const Vec &target, Vec &costs) const
 Computes the costs from already computed output.

virtual TVec< stringgetTestCostNames () const
 Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

virtual TVec< stringgetTrainCostNames () const
 Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.


Public Attributes

string training_targets
bool use_subspace_distance
bool normalize_by_neighbor_distance
bool ordered_vectors
real smart_initialization
real initialization_regularization
int n_neighbors
int n_dim
PP< Optimizeroptimizer
Var embedding
Func output_f
Func tangent_predictor
Func projection_error_f
string architecture_type
string output_type
int n_hidden_units
int batch_size
real norm_penalization
real svd_threshold
real projection_error_regularization

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Protected Attributes

Func cost_of_one_example
Var b
Var W
Var c
Var V
Var tangent_targets
VarArray parameters

Private Types

typedef PLearner inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef PLearner PLearn::TangentLearner::inherited [private]
 

Reimplemented from PLearn::PLearner.

Definition at line 59 of file TangentLearner.h.


Constructor & Destructor Documentation

PLearn::TangentLearner::TangentLearner  ) 
 

Default constructor.

Definition at line 96 of file TangentLearner.cc.


Member Function Documentation

void PLearn::TangentLearner::build  )  [virtual]
 

Simply calls inherited::build() then build_().

Reimplemented from PLearn::PLearner.

Definition at line 347 of file TangentLearner.cc.

References build_().

void PLearn::TangentLearner::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::PLearner.

Definition at line 252 of file TangentLearner.cc.

References architecture_type, cost_of_one_example, PLearn::diagonalized_factors_product(), embedding, n_dim, n_hidden_units, n_neighbors, PLearn::VarArray::nelems(), norm_penalization, normalize_by_neighbor_distance, ordered_vectors, output_f, output_type, parameters, PLERROR, PLearn::product(), PLearn::projection_error(), projection_error_f, projection_error_regularization, PLearn::TVec< Var >::resize(), PLearn::TVec< Var >::size(), svd_threshold, tangent_predictor, tangent_targets, PLearn::tanh(), training_targets, use_subspace_distance, V, W, and x.

Referenced by build().

void PLearn::TangentLearner::computeCostsFromOutputs const Vec input,
const Vec output,
const Vec target,
Vec costs
const [virtual]
 

Computes the costs from already computed output.

Implements PLearn::PLearner.

Definition at line 506 of file TangentLearner.cc.

References PLERROR.

void PLearn::TangentLearner::computeOutput const Vec input,
Vec output
const [virtual]
 

Computes the output from the input.

Implements PLearn::PLearner.

Definition at line 499 of file TangentLearner.cc.

References output_f, outputsize(), PLearn::TVec< T >::resize(), and PLearn::Vec.

void PLearn::TangentLearner::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::PLearner.

Definition at line 153 of file TangentLearner.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::TangentLearner::forget  )  [virtual]
 

(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!).

Implements PLearn::PLearner.

Definition at line 375 of file TangentLearner.cc.

References initializeParams().

TVec< string > PLearn::TangentLearner::getTestCostNames  )  const [virtual]
 

Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

Implements PLearn::PLearner.

Definition at line 512 of file TangentLearner.cc.

References getTrainCostNames().

TVec< string > PLearn::TangentLearner::getTrainCostNames  )  const [virtual]
 

Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.

Implements PLearn::PLearner.

Definition at line 517 of file TangentLearner.cc.

Referenced by getTestCostNames().

void PLearn::TangentLearner::initializeParams  )  [virtual]
 

Definition at line 444 of file TangentLearner.cc.

References architecture_type, PLearn::fill_random_uniform(), initialization_regularization, PLearn::PLearner::inputsize(), PLearn::manual_seed(), n_hidden_units, optimizer, PLERROR, PLearn::seed(), smart_initialization, PLearn::smartInitialization(), PLearn::sqrt(), V, and W.

Referenced by forget().

void PLearn::TangentLearner::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Definition at line 355 of file TangentLearner.cc.

References cost_of_one_example, PLearn::deepCopyField(), optimizer, parameters, tangent_predictor, tangent_targets, V, PLearn::varDeepCopyField(), and W.

int PLearn::TangentLearner::outputsize  )  const [virtual]
 

Returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options).

Implements PLearn::PLearner.

Definition at line 370 of file TangentLearner.cc.

References output_f.

Referenced by computeOutput().

PLearn::TangentLearner::PLEARN_DECLARE_OBJECT TangentLearner   ) 
 

void PLearn::TangentLearner::train  )  [virtual]
 

The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process.

Implements PLearn::PLearner.

Definition at line 381 of file TangentLearner.cc.

References batch_size, cost_of_one_example, PLearn::endl(), PLearn::hconcat(), PLearn::PLearner::inputsize(), PLearn::VMat::length(), PLearn::local_neighbors_differences(), PLearn::meanOf(), n_neighbors, optimizer, parameters, PLERROR, PLearn::tostring(), training_targets, and PLearn::ProgressBar::update().


Member Data Documentation

string PLearn::TangentLearner::architecture_type
 

Definition at line 99 of file TangentLearner.h.

Referenced by build_(), and initializeParams().

Var PLearn::TangentLearner::b [protected]
 

Definition at line 65 of file TangentLearner.h.

int PLearn::TangentLearner::batch_size
 

Definition at line 103 of file TangentLearner.h.

Referenced by train().

Var PLearn::TangentLearner::c [protected]
 

Definition at line 65 of file TangentLearner.h.

Func PLearn::TangentLearner::cost_of_one_example [protected]
 

Definition at line 64 of file TangentLearner.h.

Referenced by build_(), makeDeepCopyFromShallowCopy(), and train().

Var PLearn::TangentLearner::embedding
 

Definition at line 93 of file TangentLearner.h.

Referenced by build_().

real PLearn::TangentLearner::initialization_regularization
 

Definition at line 88 of file TangentLearner.h.

Referenced by initializeParams().

int PLearn::TangentLearner::n_dim
 

Definition at line 90 of file TangentLearner.h.

Referenced by build_().

int PLearn::TangentLearner::n_hidden_units
 

Definition at line 101 of file TangentLearner.h.

Referenced by build_(), and initializeParams().

int PLearn::TangentLearner::n_neighbors
 

Definition at line 89 of file TangentLearner.h.

Referenced by build_(), and train().

real PLearn::TangentLearner::norm_penalization
 

Definition at line 105 of file TangentLearner.h.

Referenced by build_().

bool PLearn::TangentLearner::normalize_by_neighbor_distance
 

Definition at line 85 of file TangentLearner.h.

Referenced by build_().

PP<Optimizer> PLearn::TangentLearner::optimizer
 

Definition at line 92 of file TangentLearner.h.

Referenced by initializeParams(), makeDeepCopyFromShallowCopy(), and train().

bool PLearn::TangentLearner::ordered_vectors
 

Definition at line 86 of file TangentLearner.h.

Referenced by build_().

Func PLearn::TangentLearner::output_f
 

Definition at line 94 of file TangentLearner.h.

Referenced by build_(), computeOutput(), and outputsize().

string PLearn::TangentLearner::output_type
 

Definition at line 100 of file TangentLearner.h.

Referenced by build_().

VarArray PLearn::TangentLearner::parameters [protected]
 

Definition at line 73 of file TangentLearner.h.

Referenced by build_(), makeDeepCopyFromShallowCopy(), and train().

Func PLearn::TangentLearner::projection_error_f
 

Definition at line 96 of file TangentLearner.h.

Referenced by build_().

real PLearn::TangentLearner::projection_error_regularization
 

Definition at line 107 of file TangentLearner.h.

Referenced by build_().

real PLearn::TangentLearner::smart_initialization
 

Definition at line 87 of file TangentLearner.h.

Referenced by initializeParams().

real PLearn::TangentLearner::svd_threshold
 

Definition at line 106 of file TangentLearner.h.

Referenced by build_().

Func PLearn::TangentLearner::tangent_predictor
 

Definition at line 95 of file TangentLearner.h.

Referenced by build_(), and makeDeepCopyFromShallowCopy().

Var PLearn::TangentLearner::tangent_targets [protected]
 

Definition at line 66 of file TangentLearner.h.

Referenced by build_(), and makeDeepCopyFromShallowCopy().

string PLearn::TangentLearner::training_targets
 

Definition at line 83 of file TangentLearner.h.

Referenced by build_(), and train().

bool PLearn::TangentLearner::use_subspace_distance
 

Definition at line 84 of file TangentLearner.h.

Referenced by build_().

Var PLearn::TangentLearner::V [protected]
 

Definition at line 65 of file TangentLearner.h.

Referenced by build_(), initializeParams(), and makeDeepCopyFromShallowCopy().

Var PLearn::TangentLearner::W [protected]
 

Definition at line 65 of file TangentLearner.h.

Referenced by build_(), initializeParams(), and makeDeepCopyFromShallowCopy().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:28:01 2004 for PLearn by doxygen 1.3.7