Newer
Older

Michal Kravcenko
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* DESCRIPTION OF THE FILE
*
* @author Michal Kravčenko
* @date 19.2.19 -
*/
#ifndef LIB4NEURO_LEARNINGSEQUENCE_H
#define LIB4NEURO_LEARNINGSEQUENCE_H
#include <4neuro.h>
#include "../settings.h"
#include "../constants.h"
#include "ILearningMethods.h"
namespace lib4neuro {
/**
*
*/
class LearningSequence : public ILearningMethods {
private:
/**
*
*/
std::vector<ILearningMethods*> learning_sequence;
/**
*
*/
double tol;
/**
*
*/
std::vector<double> *best_parameters = nullptr;
/**
*
*/
int max_number_of_cycles = -1;
public:
/**
*
*/
LIB4NEURO_API explicit LearningSequence( double tolerance = 1e-6, int max_n_cycles = -1);
/**
* Deallocates the instance
*/
LIB4NEURO_API ~LearningSequence();
/**
*
* @param ef
* @param ofs
*/
LIB4NEURO_API void optimize(lib4neuro::ErrorFunction &ef, std::ofstream* ofs = nullptr) override;
/**
*
* @return
*/
LIB4NEURO_API std::vector<double> *get_parameters() override;
/**
*
* @param method
*/
LIB4NEURO_API void add_learning_method( ILearningMethods * method );
};
}
#endif //LIB4NEURO_LEARNINGSEQUENCE_H