Commit 19846f8b authored by Martin Beseda's avatar Martin Beseda

ENH: Added serialization

parent 6fdca902
......@@ -15,6 +15,15 @@
#include "../constants.h"
class NeuronLogistic:public Neuron {
friend class boost::serialization::access;
protected:
template<class Archive>
void serialize(Archive & ar, const unsigned int version){
//TODO separate implementation to NeuronLogistic.cpp!
ar & boost::serialization::base_object<Neuron>(*this);
};
public:
/**
* Constructs the object of the Logistic neuron with activation function
......@@ -43,6 +52,7 @@ public:
* @return b * e^(a - x) * [e^(a - x) + 1]^(-b)
*/
double activation_function_get_derivative( ) override;
};
......
......@@ -15,6 +15,16 @@
#include "../constants.h"
class NeuronTanh:public Neuron {
friend class boost::serialization::access;
protected:
template<class Archive>
void serialize(Archive & ar, const unsigned int version){
//TODO separate implementation to NeuronLogistic.cpp!
ar & boost::serialization::base_object<Neuron>(*this);
};
public:
/**
* Constructs the object of the Hyperbolic Tangent >neuron with activation function
* f(x) = (e^(x-a) - e^(a-x))/(e^(x-a) + e^(a-x))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment