openModeller
Version 1.5.0
|
#include <nn_alg.hh>
Public Member Functions | |
NNAlgorithm () | |
~NNAlgorithm () | |
int | needNormalization () |
int | initialize () |
int | iterate () |
float | getProgress () const |
int | done () const |
Scalar | getValue (const Sample &x) const |
Public Member Functions inherited from AlgorithmImpl | |
AlgorithmImpl (AlgMetadata const *metadata) | |
virtual | ~AlgorithmImpl () |
void | setParameters (int nparam, AlgParameter const *param) |
void | setParameters (const ParamSetType &) |
std::string const | getID () const |
AlgMetadata const * | getMetadata () const |
AlgorithmPtr | getFreshCopy () |
virtual int | supportsModelProjection () const |
Model | createModel (const SamplerPtr &samp, CallbackWrapper *func=0) |
void | setSampler (const SamplerPtr &samp) |
virtual int | finalize () |
virtual int | getConvergence (Scalar *const val) const |
Normalizer * | getNormalizer () const |
void | setNormalization (const SamplerPtr &samp) const |
void | setNormalization (const EnvironmentPtr &env) const |
virtual Model | getModel () const |
ConfigurationPtr | getConfiguration () const |
void | setConfiguration (const ConstConfigurationPtr &) |
Public Member Functions inherited from Configurable | |
virtual | ~Configurable () |
Protected Member Functions | |
virtual void | _getConfiguration (ConfigurationPtr &) const |
virtual void | _setConfiguration (const ConstConfigurationPtr &) |
Protected Member Functions inherited from AlgorithmImpl | |
int | dimDomain () |
int | getParameter (std::string const &name, std::string *value) |
int | getParameter (std::string const &name, double *value) |
int | getParameter (std::string const &name, float *value) |
int | getParameter (std::string const &name, int *value) |
Protected Attributes | |
bool | _done |
int | _num_layers |
int | num_presences |
int | num_absences |
Network | network |
vector< vector< double > > | vector_input |
vector< vector< double > > | vector_output |
nn_parameter | _nn_parameter |
double * | outputs |
unsigned long | amount_epoch |
float | _progress |
int | converged |
OccurrencesPtr | absences |
OccurrencesPtr | presences |
Protected Attributes inherited from AlgorithmImpl | |
SamplerPtr | _samp |
Normalizer * | _normalizerPtr |
ParamSetType | _param |
Additional Inherited Members | |
Public Types inherited from AlgorithmImpl | |
typedef std::map< icstring, std::string > | ParamSetType |
Declaration of Neural Network algorithm class.
LICENSE INFORMATION
Copyright(c) 2007 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
NNAlgorithm::NNAlgorithm | ( | ) |
Definition at line 210 of file nn_alg.cpp.
References AlgorithmImpl::_normalizerPtr.
NNAlgorithm::~NNAlgorithm | ( | ) |
Definition at line 222 of file nn_alg.cpp.
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 622 of file nn_alg.cpp.
References _done, _nn_parameter, _num_layers, Network::getBias(), Network::getWeight(), nn_parameter::hid, and network.
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 713 of file nn_alg.cpp.
References _done, _nn_parameter, _num_layers, nn_parameter::hid, nn_parameter::learning_rate, network, Network::RandomizeWB(), Network::setBias(), Network::SetData(), and Network::setWeight().
|
virtual |
Use this method to find out if the model has completed (e.g. convergence point has been met.
Reimplemented from AlgorithmImpl.
Definition at line 579 of file nn_alg.cpp.
References _done, Log::debug(), Log::instance(), and NN_LOG_PREFIX.
Referenced by getProgress().
|
virtual |
Return progress so far
Reimplemented from AlgorithmImpl.
Definition at line 560 of file nn_alg.cpp.
References _progress, and done().
This method is used when projecting the model.
x | Pointer to a vector of openModeller Scalar type (currently double). The vector should contain values looked up on the environmental variable layers into which the mode is being projected. |
This method is used when projecting the model.
Scalar | *x a pointer to a vector of openModeller Scalar type (currently double). The vector should contain values looked up on the environmental variable layers into which the mode is being projected. |
Implements AlgorithmImpl.
Definition at line 597 of file nn_alg.cpp.
References _num_layers, Network::GetOutput(), network, and Network::SetInputs().
|
virtual |
Initialise the model specifying a threshold / cutoff point. This is optional (model dependent).
Implements AlgorithmImpl.
Definition at line 252 of file nn_alg.cpp.
References _nn_parameter, AlgorithmImpl::_normalizerPtr, _num_layers, AlgorithmImpl::_samp, absences, amount_epoch, nn_parameter::choice, CHOICE_ID, Normalizer::computeNormalization(), createSampler(), Log::debug(), nn_parameter::epoch, EPOCH_ID, Log::error(), AlgorithmImpl::getParameter(), nn_parameter::hid, HIDDEN_ID, nn_parameter::inp, Log::instance(), nn_parameter::learning_rate, LEARNING_RATE_ID, MIN_ERROR_ID, nn_parameter::minimum_error, nn_parameter::momentum, MOMENTUM_ID, network, NN_LOG_PREFIX, num_absences, num_presences, nn_parameter::outp, nn_parameter::pattern, presences, Network::RandomizeWB(), Network::SetData(), AlgorithmImpl::setNormalization(), vector_input, vector_output, and Log::warn().
|
virtual |
Start model execution (build the model).
Reimplemented from AlgorithmImpl.
Definition at line 498 of file nn_alg.cpp.
References _done, _nn_parameter, _progress, amount_epoch, nn_parameter::choice, converged, nn_parameter::epoch, Network::getProgress(), Log::info(), Log::instance(), nn_parameter::minimum_error, nn_parameter::momentum, network, NN_LOG_PREFIX, nn_parameter::pattern, Network::Train(), Network::trainingEpoch(), Network::trainingMinimumError(), vector_input, vector_output, and Log::warn().
|
virtual |
The algorithm should return != 0 if it needs normalization of environmental variables (non categorical ones).
Reimplemented from AlgorithmImpl.
Definition at line 229 of file nn_alg.cpp.
References AlgorithmImpl::_samp.
|
protected |
Definition at line 100 of file nn_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), done(), and iterate().
|
protected |
Definition at line 117 of file nn_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), initialize(), and iterate().
|
protected |
Definition at line 102 of file nn_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), and initialize().
|
protected |
Definition at line 123 of file nn_alg.hh.
Referenced by getProgress(), and iterate().
|
protected |
Definition at line 130 of file nn_alg.hh.
Referenced by initialize().
|
protected |
Definition at line 121 of file nn_alg.hh.
Referenced by initialize(), and iterate().
|
protected |
|
protected |
Definition at line 111 of file nn_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), initialize(), and iterate().
|
protected |
Definition at line 106 of file nn_alg.hh.
Referenced by initialize().
|
protected |
Definition at line 104 of file nn_alg.hh.
Referenced by initialize().
|
protected |
Definition at line 132 of file nn_alg.hh.
Referenced by initialize().
|
protected |
Definition at line 113 of file nn_alg.hh.
Referenced by initialize(), and iterate().
|
protected |
Definition at line 115 of file nn_alg.hh.
Referenced by initialize(), and iterate().