Skip to content
Snippets Groups Projects
Commit 25ee61e5 authored by Martin Beseda's avatar Martin Beseda
Browse files

[ENH] Added ACSFNN serialization

parent b4f5a84d
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,12 @@ namespace lib4neuro {
public:
/**
* Struct used to access private properties from
* the serialization function
*/
struct access;
LIB4NEURO_API explicit ACSFNeuralNetwork(std::unordered_map<ELEMENT_SYMBOL, Element*>& elements,
std::vector<ELEMENT_SYMBOL>& elements_list,
bool with_charge,
......
//
// Created by martin on 07.11.19.
//
#ifndef LIB4NEURO_ACSFNEURALNETWORKSERIALIZATION_H
#define LIB4NEURO_ACSFNEURALNETWORKSERIALIZATION_H
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include "ACSFNeuralNetwork.h"
#include "Neuron/NeuronSerialization.h"
#include "Neuron/NeuronBinarySerialization.h"
#include "Neuron/NeuronConstantSerialization.h"
#include "Neuron/NeuronLinearSerialization.h"
#include "Neuron/NeuronLogisticSerialization.h"
#include "NetConnection/ConnectionFunctionGeneralSerialization.h"
#include "NetConnection/ConnectionFunctionIdentitySerialization.h"
BOOST_CLASS_EXPORT_KEY(lib4neuro::ACSFNeuralNetwork);
namespace lib4neuro {
struct ACSFNeuralNetwork::access {
template<class Archive>
static void serialize(Archive& ar,
ACSFNeuralNetwork& nn,
const unsigned int version) {
ar & boost::serialization::base_object<NeuralNetwork>(nn);
ar & elements;
ar & elements_list;
}
};
}
namespace boost {
namespace serialization {
/**
* Serialization function
* @tparam Archive Boost library template
* @param ar Boost parameter - filled automatically during serialization!
* @param ds NeuralNetwork instance
* @param version Boost parameter - filled automatically during serialization!
*/
template<class Archive>
void serialize(Archive& ar,
lib4neuro::ACSFNeuralNetwork& nn,
const unsigned int version) {
lib4neuro::ACSFNeuralNetwork::access::serialize(ar,
nn,
version);
}
} // namespace serialization
} // namespace boost
#endif //LIB4NEURO_ACSFNEURALNETWORKSERIALIZATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment