Newer
Older
#include <boost/serialization/export.hpp>
#include "NeuronSerialization.h"
#include "NeuronBinaryBiasedSerialization.h"
#include "NeuronConstant.h"
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
BOOST_CLASS_EXPORT_IMPLEMENT(lib4neuro::NeuronBinaryBiased)
namespace lib4neuro {
NeuronBinaryBiased::NeuronBinaryBiased(double b) {
this->bias = b;
}
double NeuronBinaryBiased::activate(double x,
double b) {
if (x >= this->bias) {
this->activation_val = 1.0;
} else {
this->activation_val = 0.0;
}
return this->activation_val;
}
double NeuronBinaryBiased::activation_function_eval_derivative_bias(double x,
double b) {
// f'(0) = 0 for the purposes of training
return 0.0;
}
double NeuronBinaryBiased::activation_function_eval_derivative(double x,
double b) {
// f'(0) = 0 for the purposes of training
return 0.0;
}
Neuron* NeuronBinaryBiased::get_derivative() {
NeuronConstant* output = new NeuronConstant(0.0);
return output;
}
}