Newer
Older

Michal Kravcenko
committed
/**
* DESCRIPTION OF THE FILE
*
* @author Michal Kravčenko
* @date 8.8.18 -
*/
#ifndef INC_4NEURO_NEURONCONSTANT_H
#define INC_4NEURO_NEURONCONSTANT_H
Martin Beseda
committed
namespace lib4neuro {
class NeuronConstant : public NeuronDifferentiable {
Martin Beseda
committed
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
private:
double p = 0.0;
public:
/**
* Struct used to access private properties from
* the serialization function
*/
struct access;
/**
* Constructs the object of the Linear neuron with activation function
* f(x) = c
* @param[in] c Constant value
*/
LIB4NEURO_API explicit NeuronConstant(double c = 0.0);
/**
* Evaluates and returns 'c'
*/
LIB4NEURO_API double activate(double x, double b) override;
/**
* Calculates the partial derivative of the activation function
* f(x) = c at point x
* @return Partial derivative of the activation function according to the
* 'bias' parameter. Returns 0.0
*/
LIB4NEURO_API double activation_function_eval_derivative_bias(double x, double b) override;
/**
* Calculates d/dx of (c) at point x
* @return 0.0
*/
LIB4NEURO_API double activation_function_eval_derivative(double x, double b) override;
/**
* Returns a pointer to a Neuron with derivative as its activation function
* @return
*/
LIB4NEURO_API Neuron *get_derivative() override;
};
}

Michal Kravcenko
committed
#endif //INC_4NEURO_NEURONCONSTANT_H