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
cef2f6b1
Commit
cef2f6b1
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
ENH: added output to the file for more function in simulator.cpp
parent
099d3329
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/examples/simulator.cpp
+4
-4
4 additions, 4 deletions
src/examples/simulator.cpp
with
4 additions
and
4 deletions
src/examples/simulator.cpp
+
4
−
4
View file @
cef2f6b1
...
...
@@ -53,7 +53,7 @@ int main(int argc, char** argv){
// Creation of fully connected feed-forward network with linear activation functions for input and output
// layers and the specified a.f. for the hidden ones
std
::
vector
<
l4n
::
NEURON_TYPE
>
hidden_type_v
=
{
l4n
::
NEURON_TYPE
::
LOGISTIC
,
l4n
::
NEURON_TYPE
::
LINEAR
};
l4n
::
FullyConnectedFFN
nn
(
&
neuron_numbers_in_layers
,
&
hidden_type_v
);
l4n
::
FullyConnectedFFN
nn
(
&
neuron_numbers_in_layers
,
&
hidden_type_v
,
&
output_file
);
/* Error function */
l4n
::
MSE
mse
(
&
nn
,
&
ds
);
// First parameter - neural network, second parameter - data-set
...
...
@@ -91,7 +91,7 @@ int main(int argc, char** argv){
// 1) Threshold for the successful ending of the optimization - deviation from minima
// 2) Number of iterations to reset step size to tolerance/10.0
// 3) Maximal number of iterations - optimization will stop after that, even if not converged
l4n
::
GradientDescent
gs
(
1e-3
,
100
,
20
0
);
l4n
::
GradientDescent
gs
(
1e-3
,
100
,
1
0
);
// Weight and bias randomization in the network according to the uniform distribution
// Calling methods nn.randomize_weights() and nn.randomize_biases()
...
...
@@ -115,13 +115,13 @@ int main(int argc, char** argv){
nn
.
save_text
(
"test_net.4n"
);
/* Check of the saved network - print to STDOUT */
std
::
cout
<<
std
::
endl
<<
"The original network info:"
<<
std
::
endl
;
std
::
cout
<<
std
::
flush
<<
std
::
endl
<<
"The original network info:"
<<
std
::
endl
;
nn
.
write_stats
();
nn
.
write_weights
();
nn
.
write_biases
();
l4n
::
NeuralNetwork
nn_loaded
(
"test_net.4n"
);
std
::
cout
<<
std
::
endl
<<
"The loaded network info:"
<<
std
::
endl
;
std
::
cout
<<
std
::
flush
<<
std
::
endl
<<
"The loaded network info:"
<<
std
::
endl
;
nn_loaded
.
write_stats
();
nn
.
write_weights
();
nn
.
write_biases
();
...
...
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