Coder Social home page Coder Social logo

Comments (4)

 avatar commented on July 28, 2024

BTW: It is not a problem to reproduce the same error. It is enought to run the sample code 100x times and you can get the same problem.

from encog-dotnet-core.

 avatar commented on July 28, 2024

I probably know, where is the problem, I used this (basic) code
...
do
{
train.Iteration();
Console.WriteLine("Epoch #" + epoch + " Error:" + Format.FormatPercent(train.Error));
Console.WriteLine("Evaluated error: " + Format.FormatPercent(network.CalculateError(trainingSet)));
epoch++;
} while (train.Error > 0.001);
...

and I got these outputs:
...
Epoch #35 Error:0,125270%
Evaluated error: 0,058253%
Epoch #36 Error:0,058253%
Evaluated error: 22,434797%
Final evaluated error: 22,434797%
Neural Network Results:
0,0, actual=0,023279943378334,ideal=0
1,0, actual=0,351834582261846,ideal=1
0,1, actual=0,309542538954124,ideal=1
1,1, actual=7,84406348522279E-05,ideal=0

The problem is, that in some situations the calculation of train.Error and network.CalculateError can generate huge difference as in my sample 0,058253% (train.Error) vs 22,434797% (CalculateError).

I didn't have problem with topic huge difference in situation when I used cycle with "while (network.CalculateError(trainingSet) > 0.001);". It takes more time for training, but output of training is corrent in all situations (it would be fine to have final solution not this work-around).

BTW: This problem is also in Java code, I tested C# and Java also.

from encog-dotnet-core.

jeffheaton avatar jeffheaton commented on July 28, 2024

This is the way that the training code is designed. train.Error is the error at the beginning of a training iteration (before weights are updated), whereas CalculateError is the error AFTER an iteration. They will always move sort of lockstep like you have there. Your results above seem to follow this, as epoch 35's evaluated error becomes the regular error for epoch 36, same thing on 36 to the final.

More info here:

http://www.jeffheaton.com/2014/03/when-is-a-models-training-error-calculated/

Also, sometimes, the random weights will produce a network that cannot be trained for XOR. If it takes 100 or so runs to see a large difference, you might be seeing that case.

from encog-dotnet-core.

XeonMan avatar XeonMan commented on July 28, 2024

Why did Epoch#36 jump from train.Error:0,058253% to a whopping Evaluated error: 22,434797%, whereas Epoch#35 decreased from train.Error:0,125270% to Evaluated error: 0,058253%, which is to be more or so expected?

from encog-dotnet-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.