Exploring Unsupervised Neural Networks with Pytorch Examples ...
discuss.pytorch.org › t › exploring-unsupervisedAug 01, 2021 · def parametricSolutions(t, nn, t0, x1): # parametric solutions N1 = nn(t)[0] # first neural network output N2 = nn(t)[1] # second neural network output dt =t-t0 f = (1-torch.exp(-dt))*(1-torch.exp(dt-1)) psi1_hat = x1 + f*N1 psi2_hat = x1 + f*N2 return psi1_hat, psi2_hat def dfx(x,f): # Calculate the derivative with auto-differention return grad([f], [x], grad_outputs=torch.ones(f.shape, dtype=dtype), create_graph=True)[0] def hamEqs_Loss(t,psi1, psi2, E1, E2): # one-dimensional S.E. psi1_dx ...