deepxde
deepxde copied to clipboard
How to train a model that suits for different initial conditions
Hi, doctor lu, thanks for your brilliant job.
Recently, based on deepxde, I have implemented the solution of an ODE systems with 4 equations. The initial condition was privided by the dde.icbc.IC
module. However, the trained model can only make predictions based on the specific initial condition set before training.
I need a model that can work for different initial conditions, just like the initial conditon is also a input to the network. I have read the Q&A section of documents and I have some ideas as follows:
- The 4 initial conditions are another 4 inputs to the network besides the time domain;
- Use
dde.geometry.Timedomain
to generate training and test datasets, then mesh them with discrete intial condition dataset, then useanchors=...
to pass the mesh results to the network; - Pass a empty list to
bcs
indde.data.PDE
class; - Based on the time domain input, use
tf.sign
ortf.where
functions to segment ODE equations as a initial part and a normal part; - The initial part return a MSE loss bewteen
y(t=0)
and initial condition inputs; - The normal part return the results of normalized ODE quations.
Based on your experience, is this feasible enough? Or do you have any experiences and methods? Looking forward to your suggestions @lululxvi , thanks a lot.
Maybe you can read the DeepONet https://deepxde.readthedocs.io/en/latest/user/research.html#deeponet-mionet-deepm-mnet
Also see FAQ "Q: Solve parametric PDEs."