You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dear lulu
I had counter this problem,the loss is very low,but the prediction is always 0
here is my code
def pde(x, y):
y0 = y[:,0:1]
y1 = y[:,1:2]
dy0_xx = dde.grad.hessian(y, x,component=0)
dy1_xx = dde.grad.hessian(y, x,component=1)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
dear lulu
I had counter this problem,the loss is very low,but the prediction is always 0
here is my code
def pde(x, y):
y0 = y[:,0:1]
y1 = y[:,1:2]
dy0_xx = dde.grad.hessian(y, x,component=0)
dy1_xx = dde.grad.hessian(y, x,component=1)
def pde(x, y):
y0 = y[:,0:1]
y1 = y[:,1:2]
dy0_xx = dde.grad.hessian(y, x,component=0)
dy1_xx = dde.grad.hessian(y, x,component=1)
def boundary(x, on_boundary):
return on_boundary
def boundary_r(x, on_boundary):
return on_boundary and dde.utils.isclose(x[0], 0)
def boundary_l(x, on_boundary):
return on_boundary and dde.utils.isclose(x[0], 2.0)
def func_rigth_u0(x, y):
result = - k0 * y[:, 1:2]
return result
def boundary(x, on_boundary):
return on_boundary
def boundary_r(x, on_boundary):
return on_boundary and dde.utils.isclose(x[0], 0)
def boundary_l(x, on_boundary):
return on_boundary and dde.utils.isclose(x[0], 2.0)
def func_rigth_u0(x, y):
result = - k0 * y[:, 1:2]
return result
def create_model(config):
learning_rate, num_dense_layers, num_dense_nodes, activation, num_sigma = config
geom = dde.geometry.Interval(0, 2.0)
bc0_outer = dde.RobinBC(geom, func_rigth_u0, boundary_r, component=0)
bc1_outer = dde.RobinBC(geom, func0_rigth_u1, boundary_r, component=1)
bc0_inner = dde.NeumannBC(geom, func0_left_u0, boundary_l, component=0)
bc1_inner = dde.NeumannBC(geom, func0_left_u1, boundary_l, component=1)
bcs = [ bc0_inner,bc1_inner,bc0_outer,bc1_outer]
data = dde.data.PDE(
geom,
pde,
bcs,
1600,
2,
train_distribution="pseudo",
solution=func,
num_test=1000,
#auxiliary_var_function=ex_func
)
Beta Was this translation helpful? Give feedback.
All reactions