Commit e03cc9b4 authored by Michal Kravcenko's avatar Michal Kravcenko

MOD: modified serialization example to correctly use the loaded network

parent e3c0d25f
......@@ -123,12 +123,12 @@ int main() {
std::cout << "--------------------------------------------------------------------------------------------------------------------------------------------" <<std::endl;
error = 0.0;
inp = {0, 1};
net.eval_single( inp, out );
net2.eval_single( inp, out );
error += (0.5 - out[0]) * (0.5 - out[0]);
std::cout << "x = (0, 1), expected output: 0.50, real output: " << out[0] << std::endl;
inp = {1, 0.5};
net.eval_single( inp, out );
net2.eval_single( inp, out );
error += (0.75 - out[0]) * (0.75 - out[0]);
std::cout << "x = (1, 0.5), expected output: 0.75, real output: " << out[0] << std::endl;
std::cout << "Error of the network: " << 0.5 * error << std::endl;
......
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