Something went wrong on our end
-
Martin Beseda authored
[ENH] [RUNTIME ERROR]: moved 'optimal_parameters' variable and its getter to the LearningMethod class.
Martin Beseda authored[ENH] [RUNTIME ERROR]: moved 'optimal_parameters' variable and its getter to the LearningMethod class.
LearningMethod.h 1.19 KiB
/**
* This file contains an interface for all learning methods in the library
*
* @author Michal Kravčenko
* @date 12.8.18 -
*/
#ifndef LIB4NEURO_ILEARNINGMETHODS_H
#define LIB4NEURO_ILEARNINGMETHODS_H
#include <vector>
#include "../ErrorFunction/ErrorFunctions.h"
namespace lib4neuro {
class LearningMethod {
protected:
/**
* Vector of minima coordinates
*/
std::vector<double> optimal_parameters;
public:
/**
* Runs the method specific learning algorithm minimizing the given error function
*/
virtual void optimize(lib4neuro::ErrorFunction& ef,
std::ofstream* ofs = nullptr) = 0;
/**
* Updates the optimal weight&bias settings in the passed vector
*/
virtual std::vector<double>* get_parameters();
};
class GradientLearningMethod : public LearningMethod {
public:
/**
* Runs the method specific learning algorithm minimizing the given error function
*/
virtual void optimize(ErrorFunction& ef,
std::ofstream* ofs = nullptr) override;
};
}
#endif //LIB4NEURO_ILEARNINGMETHODS_H