New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing piece-wise PDEs #185
Comments
You need to combine these two cases in one ODE as dy1/dt = f1(t, y1, y2) and dy2/dt = f2(t, y1, y2), and then everything is the same. There might be more than one solutions to define f1 and f2, such that f1 and f2 depend on t. One way is that you can use tf.math.sign (https://www.tensorflow.org/api_docs/python/tf/math/sign) to define f1 and f2. |
You can use |
Thank you for the advice, but I've found an alternate approach with |
@azhu529 Did you have to change the last layer of your network to be as in: |
Yes, the output layer was |
Hi @lululxvi, thanks for the excellent library.
I am interested in creating a PDE to be learned by the neural network that depends on an input condition.
For instance, from example ode_system.py:
This solves dy1/dx = y2 and dy2/dx = -y1.
What if I wanted it to solve those equations if x in [0,10], then solve for a different condition like dy1/dx = 0 and dy2/dx = 1 if x in (10, 100] using y1(10) and y2(10) as the new "initial" conditions?
Is there a way to get just one network to learn this instead of training multiple networks for each piece? I tried implementing this by changing my PDE function, but eager execution is disabled even though I'm running TF 2.
Many thanks.
The text was updated successfully, but these errors were encountered: