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

FNN class constructor does not contain regularization implementation for PyTorch backend #1703

Open cwoolfo1 opened 5 months ago

cwoolfo1 commented 5 months ago

The FFN class constructor for the PyTorch backend does not contain the option to set regularization in its initialization despite having the regularizer as a attribute of the nn base class.

I had to set it manually in my code


net = dde.nn.FNN(layer_size, activation, initializer)
net.regularizer = ["l2", 1e-6]
lululxvi commented 5 months ago

Feel free to submit a PR to improve the code.