Hi everyone,
I’m currently trying to train a physics informed NN and I have a (probably very) simple question regarding autograd.
My training samples are points in space and time, i.e. a two-dimensional tensor and my question is as follows. When I compute the gradient wrt. the training data, i.e.
gradient = torch.autograd.grad(u,
trainingData,
create_graph=True,
allow_unused=True)
and I want to obtain the time derivative (first component of training data) of u, does the time derivative coincide with this quantity:
dtU = gradient[0][0]?
And similarly, If I want to obtain the spatial derivative, would It be this quantity:
dxU = gradient[0][1]?
Thank you very much for your help!
Best
Fabian