nanditadoloi / pinn Goto Github PK
View Code? Open in Web Editor NEWSimple PyTorch Implementation of Physics Informed Neural Network (PINN)
License: MIT License
Simple PyTorch Implementation of Physics Informed Neural Network (PINN)
License: MIT License
in this code snippet, you are computing the derivatives of sum(u) instead of the derivatives of u
u = net(x,t)
u_x = torch.autograd.grad(u.sum(), x, create_graph=True)[0]
u_t = torch.autograd.grad(u.sum(), t, create_graph=True)[0]
pde = u_x - 2*u_t - u
return pde
This means that the PINN doesn't exactly satisfy the PDE, but rather changing the term du/dx into d(sum_u)/dx in the differential equation. While this may work on some cases (typically simple case with no near discontinuity), the code won't be able to solve more complex problems. Even problems such as Burgers' equation with small viscosity (which is considered as simple problems, shown in the paper that you cite) can't be solved with this PINN . So I suggest to change the code into
u_x = torch.autograd.grad(u, x, grad_outputs = torch.ones_like(u), retain_graph = True, create_graph=True)[0]
u_t = torch.autograd.grad(u, t, grad_outputs = torch.ones_like(u), retain_graph = True, create_graph=True)[0]
pde = u_x - 2*u_t - u
return pde
this will correctly compute the derivatives of u instead of sum(u)
Hi Nandita,
thanks for the tutorial.
Would you mind to make a tutorial on the Influenza 1978 datasets using PINNs ?
it is located in the section 3.0 of the paper
[1] - M.Raissi, N.Ramezani, P.Seshayer , "On parameter estimation approaches for predicting disease transmission through optimization, deep learning and statistical inference methods"
Hi Nandita,
Thank you very much for a great tutorial on PINN. Could you please add a reference to the PDE that you have used in this tutorial :
du/dx=2du/dt+u
with boundary condition: u(x,0)=6e^(-3x)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.