Hi Vilayannur!



 Sitaraman:

on training the logits dont seem to change at all.


I haven’t looked at your code in any detail, however:


        loss = F.mse_loss(logits[train_mask].double(), labels[train_mask].double())
        ...
        loss = Variable(loss, requires_grad = True)



“breaks the computation graph” because
Variable(loss, requires_grad = True) creates a new tensor
(that also happens to be called loss), and (by design) gradients
backpropagated to the new loss don’t get further backpropagated
through the old loss.  (And creating the new loss with
requires_grad = True doesn’t fix this.)
(As an aside, Variable has been deprecated for some time now.
You should just use regular pytorch tensors.)


    #logits = Variable(logits[train_mask].float(), requires_grad = True)
    #labels = Variable(labels[train_mask].float(), requires_grad = True)
    logits.requires_grad = True
    labels.requires_grad = True
    #logits.is_leaf = True
    #labels.is_leaf = True



This suggests that you’ve been trying to fix things by turning various
tensor properties on and off.  It might make sense to review some of
the basics of pytorch, in particular torch.autograd 1.
Best.
K. Frank