ConnectionWeight.h 1.13 KB
Newer Older
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
81
82
83
/**
 * DESCRIPTION OF THE FILE
 *
 * @author Michal Kravčenko
 * @date 14.6.18 -
 */

#ifndef INC_4NEURO_CONNECTIONWEIGHT_H
#define INC_4NEURO_CONNECTIONWEIGHT_H

#include <functional>

class ConnectionWeight {
protected:
    /**
     *
     */
    double ** param_ptrs = nullptr;

    /**
     *
     */
    int n_params = 0;

    /**
     *
     */
    std::function<double(double **, int)> weight_function;

public:

    /**
     *
     */
    ConnectionWeight();

    /**
     *
     * @param param_count
     * @param f
     */
    ConnectionWeight(int param_count, std::function<double(double **, int)> f);

    /**
     *
     * @param param_ptr
     * @param idx
     */
    void SetParamPointer(double *param_ptr, int idx);

    /**
     *
     * @param param_ptr
     */
    void SetParamPointer(double **param_ptr);

    /**
     *
     */
    ~ConnectionWeight();

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

    /**
     *
     * @param values
     */
    void set_weights(double *values);

    /**
     *
     * @param values
     */
    void adjust_weights(double *values);

};


#endif //INC_4NEURO_CONNECTIONWEIGHT_H