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
#include <boost/serialization/export.hpp>
#include "NeuronAbsolute.h"
#include "NeuronConstant.h"
#include "NeuronSerialization.h"
#include "NeuronAbsoluteSerialization.h"
#include "exceptions.h"
BOOST_CLASS_EXPORT_IMPLEMENT(lib4neuro::NeuronAbsolute);
namespace lib4neuro {
NeuronAbsolute::NeuronAbsolute() {}
double NeuronAbsolute::activate(double x,
double b) {
//this->activation_val = abs(x + b);
this->activation_val = pow((x + b),2);
return this->activation_val;
}
double NeuronAbsolute::activation_function_eval_derivative_bias(double x,
double b) {
//return (x + b > 0)? 1.0 : -1.0;
return 2 * (x + b);
}
double NeuronAbsolute::activation_function_eval_derivative(double x,
double b) {
//return (x + b > 0) ? 1.0 : -1.0;
return 2 * (x + b);
}
Neuron* NeuronAbsolute::get_derivative() {//TODO: implement this function correctly
THROW_NOT_IMPLEMENTED_ERROR("");
}
}