MeLOn
melon::MelonModel< T > Class Template Referenceabstract

#include <MeLOn.h>

Inheritance diagram for melon::MelonModel< T >:
melon::FeedForwardNet< T > melon::GaussianProcess< T > melon::SupportVectorMachine< T > melon::SupportVectorMachineOneClass< T > melon::SupportVectorRegression< T >

Public Member Functions

virtual ~MelonModel ()=default
 Default destructor. More...
 
void load_model (std::string modelName, MODEL_FILE_TYPE fileType)
 Loads new model from file. More...
 
void load_model (std::string modelPath, std::string modelName, MODEL_FILE_TYPE fileType)
 Loads new model from file. More...
 
void load_model (std::shared_ptr< const ModelData > modelData)
 Loads new model from file. More...
 

Protected Member Functions

 MelonModel (std::shared_ptr< ModelParserFactory > parserFactory)
 Constructor. More...
 
virtual void _set_data_object (std::shared_ptr< const ModelData > modelData)=0
 Sets data object containing model parameters. More...
 
template<typename RandomAccessIterator >
void _set_constraints (std::vector< T > &constraints, std::vector< T > &constraintEvaluation, RandomAccessIterator &constraintValue)
 Sets constraints required for fullspace opimization. More...
 
template<typename RandomAccessIterator >
void _set_constraints (std::vector< T > &constraints, T &constraintEvaluation, RandomAccessIterator &constraintValue)
 Sets constraints required for fullspace opimization. More...
 

Protected Attributes

bool _modelLoaded { false }
 
std::shared_ptr< ModelParserFactory_parserFactory
 

Constructor & Destructor Documentation

◆ ~MelonModel()

template<typename T >
virtual melon::MelonModel< T >::~MelonModel ( )
virtualdefault

Default destructor.

◆ MelonModel()

template<typename T >
melon::MelonModel< T >::MelonModel ( std::shared_ptr< ModelParserFactory parserFactory)
inlineprotected

Constructor.

Parameters
[in]parserFactoryis a pointer to an parser factory derived from ModelParserFactory wich creates compatible parsers for the model derived from this class

Member Function Documentation

◆ _set_constraints() [1/2]

template<typename T >
template<typename RandomAccessIterator >
void melon::MelonModel< T >::_set_constraints ( std::vector< T > &  constraints,
std::vector< T > &  constraintEvaluation,
RandomAccessIterator &  constraintValue 
)
protected

Sets constraints required for fullspace opimization.

Parameters
[out]constraintsvector containing the constraints for the given variables (difference between values given by optimizer and values calulated by model)
[in,out]constraintEvaluationvector containing the values which were calculated by the model, returned is the vector containing the values which were given by the optimizer
[in]constraintValueis an iterator which points to the beginning of the variables, for which the constraints should be set, in the vector of variables given by the optimizer

◆ _set_constraints() [2/2]

template<typename T >
template<typename RandomAccessIterator >
void melon::MelonModel< T >::_set_constraints ( std::vector< T > &  constraints,
T &  constraintEvaluation,
RandomAccessIterator &  constraintValue 
)
protected

Sets constraints required for fullspace opimization.

Parameters
[out]constraintsvector containing the constraints for the given variables (difference between values given by optimizer and values calulated by model)
[in,out]constraintEvaluationis the values which was calculated by the model, returned is the vector containing the values which were given by the optimizer
[in]constraintValueis an iterator which points to the beginning of the variables, for which the constraints should be set, in the vector of variables given by the optimizer

◆ _set_data_object()

template<typename T >
virtual void melon::MelonModel< T >::_set_data_object ( std::shared_ptr< const ModelData modelData)
protectedpure virtual

Sets data object containing model parameters.

Parameters
[in]modelDatais a ModelData object containing the data which defines the model

Implemented in melon::FeedForwardNet< T >, melon::GaussianProcess< T >, and melon::SupportVectorMachine< T >.

◆ load_model() [1/3]

template<typename T >
void melon::MelonModel< T >::load_model ( std::shared_ptr< const ModelData modelData)

Loads new model from file.

Parameters
[in]modelDatais a ModelData object containing the data which defines the model

◆ load_model() [2/3]

template<typename T >
void melon::MelonModel< T >::load_model ( std::string  modelName,
MODEL_FILE_TYPE  fileType 
)

Loads new model from file.

Parameters
[in]modelNameis the name of the model
[in]fileTypespecifies the file type of the model file

◆ load_model() [3/3]

template<typename T >
void melon::MelonModel< T >::load_model ( std::string  modelPath,
std::string  modelName,
MODEL_FILE_TYPE  fileType 
)

Loads new model from file.

Parameters
[in]modelPathis the path to the directory in which the network is located
[in]modelNameis the name of the model
[in]fileTypespecifies the file type of the model file

Member Data Documentation

◆ _modelLoaded

template<typename T >
bool melon::MelonModel< T >::_modelLoaded { false }
protected

Flag which indicates wether a model is currently loaded or not

◆ _parserFactory

template<typename T >
std::shared_ptr<ModelParserFactory> melon::MelonModel< T >::_parserFactory
protected

Pointer to a parser factory class which creates instances of parser objects fitting the type of model and file


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