deepxde
deepxde copied to clipboard
Cannot convert a symbolic tf.Tensor (Placeholder_6:0) to a numpy array
def pde2(x, y):
dy_x = dde.grad.jacobian(y, x, i=0, j=0)
dy_t = dde.grad.jacobian(y, x, i=0, j=1)
dy_xx = dde.grad.hessian(y, x, i=0, j=0)
y_pred_value = model.predict(x)
return dy_t + y_pred_value * dy_x - 0.01 / np.pi * dy_xx
NotImplementedError: Cannot convert a symbolic tf.Tensor (Placeholder_6:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.
This is the problem.
y_pred_value = model.predict(x)
Can you show me your PDE please?
def pde(x, y):
dy_x = dde.grad.jacobian(y, x, i=0, j=0)
dy_t = dde.grad.jacobian(y, x, i=0, j=1)
dy_xx = dde.grad.hessian(y, x, i=0, j=0)
return dy_t + y * dy_x - 0.01 / np.pi * dy_xx
You cannot use model.predict
in PDE definition.
You cannot use
model.predict
in PDE definition.
I want to use two networks, where the prediction value of one network appears in the loss function of the other network. How should I write the code for this