lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.64k stars 741 forks source link

How to train a model that suits for different initial conditions #612

Open yingriyanlong opened 2 years ago

yingriyanlong commented 2 years ago

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:

  1. The 4 initial conditions are another 4 inputs to the network besides the time domain;
  2. Use dde.geometry.Timedomain to generate training and test datasets, then mesh them with discrete intial condition dataset, then use anchors=... to pass the mesh results to the network;
  3. Pass a empty list to bcs in dde.data.PDE class;
  4. Based on the time domain input, use tf.sign or tf.where functions to segment ODE equations as a initial part and a normal part;
  5. The initial part return a MSE loss bewteen y(t=0) and initial condition inputs;
  6. 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.

forxltk commented 2 years ago

Maybe you can read the DeepONet https://deepxde.readthedocs.io/en/latest/user/research.html#deeponet-mionet-deepm-mnet

lululxvi commented 2 years ago

Also see FAQ "Q: Solve parametric PDEs."