Replies: 1 comment 1 reply
-
You don't provide a reference solution, then how to compute l2 relative error? Just delete |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
博士您好
我是一个接触tensorflow和deepxde的新手,在我学习deepxde的过程中,我遇到了一些我暂时解决不了的问题,在这个代码里,使用metrics=["l2 relative error"],出现错误,您能解释一下为什么吗?然后改如何改正呢?
`import deepxde as dde
import math
def pde(x,y):
dy_xx = dde.grad.hessian(y,x,i=0,j=0)
dy_yy = dde.grad.hessian(y,x,i=1,j=1)
return -dy_yy - dy_xx - 1
def boundary(_,on_boundary):
return on_boundary
geom = dde.geometry.Rectangle([0, 0], [math.pi, math.pi])
bc = dde.DirichletBC(geom,lambda x:0, boundary)
data = dde.data.PDE(geom,pde,bc,num_domain=1200,num_boundary=120,num_test=1500)
net = dde.maps.FNN([2]+[50]*4+[1],"tanh","Glorot uniform")
model = dde.Model(data,net)
model.compile("adam",lr=0.001,metrics=["l2 relative error"])
losshistory,train_state = model.train(epochs=10000)
dde.saveplot(losshistory,train_state,issave=True,isplot=True)`
这是程序的报错,但是我没有明白是为什么:
Beta Was this translation helpful? Give feedback.
All reactions