We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm a C++ programmer, therefore I'm afraid to have a lack of knowledge about how java works in the inside. I think that if I write some consequent expressions, these should be processed in sequence.
The issue I'm having is the following:
NeuralNetwork n;
void setup()
{
n = new NeuralNetwork(/*...*/);
}
void draw()
{
background(0);
n.Propagate();
n.Draw();
}
-The Neural Network is a class I just wrote.
-The Propagate() function propagates forward the input values and calculates all the neurons' value.
-The Draw() function plots the network on the canvas aswell as numerical values and weights.
Here comes the problem: If I Propagate() in the setup() function, all works fine. Else if I Propagate() in the draw() function (as shown above), values seems to update within several draw() refreshes. What is happening? Every number is shown, but the last decimal digits vary for about 1sec before converging.
Is the frameRate() forcing the graphic update before the complete calculation is finished? EDIT: setting frameRate(1) doesn't help. Numbers still suffer consecutive variations.
Thanks for any help.
Giro
Answers
@gyres --
In Processing,
draw()
is the active rendering loop -- it is called 60 times a second by default -- or once a second withframeRate(1)
, or once ifnoLoop()
is called in setup.setup()
is only called once.So your question, if I'm understanding right, is "why is my network different if I call propagate several times instead of just once?" That's hard to answer without seeing your network, but isn't that expected behavior?
@jeremydouglass
Thanks for the answer. Yes I know the setup - draw structure. I found a major error in my code. Sorry for your time.
@gyres That's why I sent you here, it's better to get you code checked once by us forum guys than to get the already busy Processing guys worried.
@Lord_of_the_Galaxy you're right. I am a newbie here, thanks for the advice.