i207M / PINNacle

Codebase for PINNacle: A Comprehensive Benchmark of Physics-Informed Neural Networks for Solving PDEs.
https://arxiv.org/abs/2306.08827
MIT License
236 stars 38 forks source link

The problem with using the method named 'laaf' and 'gaaf' #2

Closed HUST-AI-HYZ closed 1 year ago

HUST-AI-HYZ commented 1 year ago

Hi, we meet a problem when we are running the cloned code with the primary settings except changing the default method from 'adam' to 'laaf' or 'gaaf'. Here is the content of logerr.txt:

Traceback (most recent call last):
  File "/scratch/tpang/yuanzhe_hu/TBv2-PINNacle/benchmark.py", line 153, in <module>
    trainer.train_all()
  File "/scratch/tpang/yuanzhe_hu/TBv2-PINNacle/trainer.py", line 98, in train_all
    model = get_model()
  File "/scratch/tpang/yuanzhe_hu/TBv2-PINNacle/benchmark.py", line 104, in get_model_dde
    net = DNN_LAAF(len(parse_hidden_layers(command_args))-1, parse_hidden_layers[0], pde.input_dim, pde.output_dim)
TypeError: 'function' object is not subscriptable

Besides, how can we run the method 'gpinn' and 'hp-vpinn' since I cannot find the specific settings for these two methods in benchmark.py file ?

HUST-AI-HYZ commented 1 year ago

I think it can be solved by using a mediator like this.

if command_args.method == "laaf":
                temp = parse_hidden_layers(command_args)
                #net = DNN_LAAF(len(parse_hidden_layers(command_args))-1, parse_hidden_layers[0], pde.input_dim, pde.output_dim)
                net = DNN_LAAF(len(parse_hidden_layers(command_args))-1, temp[0], pde.input_dim, pde.output_dim)
elif command_args.method == "gaaf":
                temp = parse_hidden_layers(command_args)
                #net = DNN_GAAF(len(parse_hidden_layers(command_args))-1, parse_hidden_layers[0], pde.input_dim, pde.output_dim)
                net = DNN_GAAF(len(parse_hidden_layers(command_args))-1, temp[0], pde.input_dim, pde.output_dim)
i207M commented 1 year ago

Thanks. Fixed in the 0c66054b0b2e70b2e5eb0ab6189b6ed3a735053b