Skip to content
Snippets Groups Projects
NeuronRectifier.cpp 1.01 KiB

#include <boost/serialization/export.hpp>

#include "NeuronRectifier.h"
#include "NeuronRectifierSerialization.h"

BOOST_CLASS_EXPORT_IMPLEMENT(lib4neuro::NeuronRectifier);

namespace lib4neuro {
    NeuronRectifier::NeuronRectifier() {}

    double NeuronRectifier::activate(double x,
                                     double b) {
        this->activation_val = std::max(0,
                                        x + b);
    }

    double NeuronRectifier::activation_function_eval_derivative(double x,
                                                                double b) {
        // f'(0) = 0 for the purposes of training
        return ((x + b) > 0) ? 1 : 0;
    }

    double NeuronRectifier::activation_function_eval_derivative(double x,
                                                                double b) {
        // f'(0) = 0 for the purposes of training
        return ((x + b) > 0) ? 1 : 0;
    }

    Neuron* NeuronRectifier::get_derivative() {
        NeuronConstant* output = new NeuronConstant();
    }


}