Closed shalinkpatel closed 4 years ago
I'm not sure what you are trying to do with that predict
function. The ways you're using ...
are very unnecessary. Did you mean
reduce(hcat,[n_ode(x,p)[end] for x in X])
?
Probably. I wanted to create something that predicts one timestep into the future but I have 1258 timesteps that I can train on. So for each of these points in time I wanted to get a prediction for one step into the future and then train on the loss between these values and the actual values that were recorded. So predict
collates the results of this into a 29x1258 Matrix as there are 29 different series I am training this against.
Then just do Array(sol)
and save the time series?
Maybe this doesn't make sense, but I want to reset the initial conditions each time-step. So at time 0 I use the i.c. as the system state at time 0 and predict for time 1. For time 1 I want to use the actual values at time 1 as the i.c. and predict for time 2 and so on.
I guess this doesn't make much sense I and I should predict on the whole time series.
actual values, as in from the dataset?
Yes. But in either case, would I not end up with a 29 x 1258 matrix as the output of the system? Is the issue here that Zygote can't differentiate through the ...
?
Then reduce(hcat,[n_ode(x,p)[end] for x in X])
is exactly what you want.
Got it thanks! Appreciate it.
No problem. It should just work, and be a lot faster since splatting can be slow.
Yea works like a charm now.
I am attempting to use DiffEqFlux for the first time and keep running into the error in the subject. Below is my code (I put in the VSCode screenshot so the data shapes are clear). I was wondering if I could get any help. I am a little new to the area and I might be doing something that's painfully wrong so please let me know.
Stacktrace: