lululxvi / deepxde

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

add mixed precision support to deepxde #1650

Open g-w1 opened 9 months ago

lululxvi commented 4 months ago

If I use the API here to set mixed precision, then all the demo code can run in mixed precision?

g-w1 commented 4 months ago

Not all. The L-BFGS optimizer doesn't work in mixed precision. But if you add the line dde.config.set_default_float("mixed") to the top of your file, it should work unless it uses a feature (like L-BFGS) that is not supported with mixed precision. I have tested this on the Burgers.py example and it works.