deepxde
deepxde copied to clipboard
Is it possible to compute the gradients after the functions approximation?
After doing a function approximation is it possible to compute gradients using the trained network.
Here is what I am trying to do.
my_data = genfromtxt('dataset.train')
x = my_data[:,0]
y = my_data[:,1]
x_np = torch.from_numpy(x)
y_np = torch.from_numpy(y)
<Something to connect them with the neural network graph.>
dde.grad.hessian(y_np, x_np, i=0, j=0)
Can anyone help me to connect this gradient to the neural network graph?
See https://deepxde.readthedocs.io/en/latest/demos/pinn_forward/poisson.1d.dirichlet.html