ConnectionWeight.h 1.21 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
/**
 * DESCRIPTION OF THE FILE
 *
 * @author Michal Kravčenko
 * @date 14.6.18 -
 */

#ifndef INC_4NEURO_CONNECTIONWEIGHT_H
#define INC_4NEURO_CONNECTIONWEIGHT_H

#include <functional>
12
#include <vector>
13
14
15
16
17
18

class ConnectionWeight {
protected:
    /**
     *
     */
19
20
21
22
23
24
    std::vector<double>* weight_array = nullptr;

    /**
     *
     */
    int* param_indices = nullptr;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

    /**
     *
     */
    int n_params = 0;

public:

    /**
     *
     */
    ConnectionWeight();

    /**
     *
     * @param param_count
     * @param f
     */
43
    ConnectionWeight(int param_count, std::vector<double>* w_array);
44
45
46

    /**
     *
47
     * @param value
48
49
     * @param idx
     */
50
    void SetParamIndex(int value, int idx);
51
52
53
54
55

    /**
     *
     * @param param_ptr
     */
56
    void SetParamIndices(int* param_ptr);
57
58
59
60

    /**
     *
     */
61
    virtual ~ConnectionWeight();
62
63
64
65
66
67
68
69
70
71
72

    /**
     *
     * @return
     */
    virtual double eval();

    /**
     *
     * @param values
     */
David Vojtek's avatar
David Vojtek committed
73

74
75
    void set_weights(double *values);

David Vojtek's avatar
David Vojtek committed
76
77
78
79
80
    /**
     *
     * @return vector of weights
     */
    std::vector<double> get_weights();
81
82
83
84
85
86
87
88
89
90
    /**
     *
     * @param values
     */
    void adjust_weights(double *values);

};


#endif //INC_4NEURO_CONNECTIONWEIGHT_H