Hello everyone,
I've been struggling for a while on the neural ODE example here. The example deals with autonomous systems
and my goal is simply to move from this to
. I have read the related discussion here but still have some questions. The data generation is no problem, as I simply replace :
[~, xTrain] = ode45(trueModel, t, x0, odeOptions);
with the following lines:
trueModel = @(t,y,u) A*y+B*u;
[~, xTrain] = ode45(@(t,y) trueModel(t,y,u), t, x0, odeOptions);
The example then creates mini-batch = 200 which creates a set of initial condition x0 of size [2 200], and targets [2 200 40], as the neuralOdeTimesteps = 40;
I have updated the code to split the inputs used for data generation to create a variable inputs [1 200 40].
My problem comes with the modelLoss function, when calling the neural ODE model. The value of the state during learning for each mini-batch is obtained thanks to :
X = dlode45(@odeModel,tspan,X0,neuralOdeParameters,DataFormat="CB");
I was thinking of updating this function to add the corresponding input:
X = dlode45(@(t,x,p) odeModel(t,x,p,u), tspan,X0,neuralOdeParameters,DataFormat="CB");
But finally I still don't know how to update the function odeModel to take into account the input sequence ...
I hope this make sense and thank you in advance!