lululxvi / deepxde

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

Minor compatibility fix for mionet with tf_compat_v1 backend #1141

Open btsusi opened 1 year ago

btsusi commented 1 year ago

Hello, First of all, thank you for this library! It is extremely helpful and well documented. I hope you can help with a very small thing; I tried to create a pull request for a minor fix, but was not able to push to this repo for some reason. So would you please consider changing lines 83 and 136 in \nn\tensorflow_compat_v1\mionet.py as follows?

b = tf.Variable(tf.zeros(1)) to b = tf.Variable(tf.zeros(1, dtype=config.real(tf)))

I was trying to use L-BFGS with your MIONetCartesionProd framework in Windows, but the optimizer stopped well before it should have. I followed the guidance for using dde.config.set_default_float("float64"), but encountered a TensorFlow error about mismatched datatypes. The simple change above mirrors the implementation in the \nn\tensorflow_compat_v1\deeponet.py file and fixed the TF error message.

Thank you!

lululxvi commented 1 year ago

Sounds good. What is the issue when you create the PR?

btsusi commented 1 year ago

The issue that occurs when I try to create the PR is actually a problem authenticating to the repo. I have a local branch with my changes, which I try to push to the remote and I receive a "fatal: unable to access 'https://github.com/luluxvi/deepxde.git" error from Git. Is there any documentation or FAQ's for contributing to the project? Regardless, I appreciate your response!

lululxvi commented 1 year ago

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request