lululxvi / deepxde

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

How to give different inputs for subnetworks in PFNN #1735

Closed bottle88 closed 3 months ago

bottle88 commented 4 months ago

Discussed in https://github.com/lululxvi/deepxde/discussions/1733

Originally posted by **bottle88** May 11, 2024 Dear All, I have a question of using the implementation of PFNN. I have a 2D heat equation where T(x,y,t) is the solution. And I have a inverse **varaible** parameter in my BC. The parameter only applies on a particular boundary. so it is supposed to dependent on x only. In the PFNN implementation. The First NN has x,y,t as inputs and T(x,y,t) as ouput , and second NN also has x,y,t as input and C(x,y,t) as output, as far I understand. But I need the second NN to have x as input and C(x) as output. How do I do this I have seen the poison equation example, where they had unknown source field as output, and tried to implement it. But the function prediction was not at all correct. https://deepxde.readthedocs.io/en/stable/demos/pinn_inverse/elliptic.inverse.field.html. This is how I had defined, seeing the example given. `layer_size = [3, [30,30], [30,30], [30,30], [30,30], [30,30], 2] activation = "tanh" initializer = "Glorot uniform" net = dde.nn.PFNN(layer_size, activation, initializer)`. I am having doubt on what do I need to change to implement according to my condition. I am confused. I am eager to hear your response. Thankyou in Advance.