Newer
Older
#include <boost/serialization/export.hpp>
#include "NeuronSerialization.h"
#include "NeuronBinaryBiasedSerialization.h"
#include "NeuronConstant.h"
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) {
kra568
committed
return 1.0;
kra568
committed
return 0.0;
}
}
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;
}
}