I just tried to let my ensemble learn a simple division equation.
Therefore, I took two varying input-functions of p1 = (0.85 * np.sin(float(10)*float(i)/float(1000))+1.15) and
p2 =(1.15 * np.sin(float(10)*float(i)/float(1000))+1.85) This works pretty well.
But now I would like to replace the learning equation with a more variable one.
I would like to change the function, so that an additional parameter is added that changes in time.
So every time when the function is called by the connection, it has to know the actual time value.
I thought it could be an easy solution to calculate the results depending on the time in advance and save them to an array. Then I could simply implement a counter and every time the function is called it takes the next value out of the calculated array.
In a first approach I just calculated the division-equation in advance, without any changing values in the learning function. Instead it just should return the value of the calculated array at the appropriate time value.
But this seems to be no good idea, or at least I don’t understand the behavior of my model.
When I do it like this, then the results get really worse. But actually nothing should have changed.
Obviously something is wrong with my idea of implementing a simple counter. Maybe the learning function is not called every time step ?
Could anybody tell me how i can find out at which timesteps of the simulation the learning function is called?
Is it possible to use a learning-function with a time-variable?
Why does this counter-solution behave so wrong?
I put my code example to this post in hope that it makes clear what i want to do.
exp.py (5.4 KB)
Thanks in advance for every kind of help