siravan / fib_tf

MIT License
2 stars 2 forks source link

So does the performance of tensorflow is good enough to implement a stiff ODE sover? #4

Open felonwan opened 5 years ago

felonwan commented 5 years ago

Brilliant project! So, do you have a clear answer now? I'm using RNN to predict continuous time series on tensorflow. The desired ouput of squared waves is more precisely imitated by MATLAB rather than by tensorflow, more seriously the long time training won't lead to convergence in tensorflow. I don't know whether the equations is stiff, because the abrupt increase is caused by the abrupt changing inputs. The simple explicit euler method was adopted.

The results of matlab: matlab

The results of tensorflow: tensorflow

shahriariravanian commented 5 years ago

A square wave has different time-scales (rapid upstrokes and downstrokes with slow plateaus) and, by definition, should be stiff. What time of solver do you use in matlab?

felonwan commented 5 years ago

A square wave has different time-scales (rapid upstrokes and downstrokes with slow plateaus) and, by definition, should be stiff. What time of solver do you use in matlab?

I implement the explicit Euler method manually both in matlab and tensorflow.

For the square wave, 1 time step for both upstrokes and downstrokes is adopted, and the plateaus endures 60 steps. The time step is 0.01, and the unit time constant is 0.15, which means the effective time of step is 0.067.