Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
25ee61e5
Commit
25ee61e5
authored
5 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
[ENH] Added ACSFNN serialization
parent
b4f5a84d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Network/ACSFNeuralNetwork.h
+6
-0
6 additions, 0 deletions
src/Network/ACSFNeuralNetwork.h
src/Network/ACSFNeuralNetworkSerialization.h
+64
-0
64 additions, 0 deletions
src/Network/ACSFNeuralNetworkSerialization.h
with
70 additions
and
0 deletions
src/Network/ACSFNeuralNetwork.h
+
6
−
0
View file @
25ee61e5
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
src/Network/ACSFNeuralNetworkSerialization.h
0 → 100644
+
64
−
0
View file @
25ee61e5
//
// 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment