xianggebenben / dladmm Goto Github PK
View Code? Open in Web Editor NEWdlADMM: Deep Learning Optimization via Alternating Direction Method of Multipliers
dlADMM: Deep Learning Optimization via Alternating Direction Method of Multipliers
您好,非常感谢您的开源仓库,很值得学习借鉴的工作!我有个疑问,是否可以将您的算法用于PINN的训练,不知道您是否了解PINN。这里有个知乎帖子介绍:
PINN代码实现
简单说就是loss的构造跟一般的监督学习不太一样,传统监督学习中loss = Loss_(pred - ture),但在PINN中,把微分方程也加入到loss中,于是PINN的loss = Loss_(pred - ture) + Loss_pde。而构造Loss_pde过程中,需要使用自动微分求导,用来构造微分方程中的各阶导数项,进而得到Loss_pde。
pytorch实现PINN的算例代码
` def net_f(self, x, t):
""" The pytorch autograd version of calculating residual """
u = self.net_u(x, t)
u_t = torch.autograd.grad(
u, t,
grad_outputs=torch.ones_like(u),
retain_graph=True,
create_graph=True
)[0]
u_x = torch.autograd.grad(
u, x,
grad_outputs=torch.ones_like(u),
retain_graph=True,
create_graph=True
)[0]
u_xx = torch.autograd.grad(
u_x, x,
grad_outputs=torch.ones_like(u_x),
retain_graph=True,
create_graph=True
)[0]
f = u_t + u * u_x - self.nu * u_xx
return f`
上述代码就是构造Loss_pde。不知道您的算法框架中,能否实现加入这个Loss_pde,进而实现PINN的训练?看您的代码中,应该没有使用自动微分求导。
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.