lululxvi / deepxde

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

How to specify the inputs of multiple neural networks using PFNN #604

Open YunhaoYuan opened 2 years ago

YunhaoYuan commented 2 years ago

Dear All, I have a question of using the implementation of PFNN from https://github.com/lululxvi/deepxde/pull/96

For 2 neural networks (NN1, NN2) of using all the same inputs (x1, x2, x3) and all the same outputs (y1, y2), I know the syntax can be written as: layer_size = [3] + [[10, 30], [20, 40]] + [2] net = dde.maps.PFNN(layer_size=layer_size)

However, For NN1, I would like to specify x1,x3 as inputs and y1 as output For NN2, I would like to specify x2, y1 (output of NN1) and y2 as output

I could only think of the syntax of defining the layer_size that meets my requirement. layer_size = [[2],[2]] + [[10, 30], [20, 40]] + [[1],[1]] net = dde.maps.PFNN(layer_size=layer_size)

Would you please share some insights on what else I should specify in the syntax to meet my requirement using PFNN? Thanks in advance.

lululxvi commented 2 years ago

PFNN doesn't support this. See FAQ "Q: A standard network doesn’t work for me, and I want to implement a network with a special structure/property."