def compute(self, admat, features):
    ' Forward Propagation through the layer according to the spectral rule '
    self.D = torch.diag(admat.sum(1), diagonal=0)
    self.out = torch.empty(admat.size[0], self.op_size)
    self.a_hat = (admat + torch.eye(admat.size[0]))
    self.D_inv = (self.D ** (- 0.5))
    self.a_hat = ((self.D_inv * self.a_hat) * self.D_inv)
    self.out = torch.dot(torch.dot(self.a_hat, features), self.weights)
    return self.out
Forward Propagation through the layer according to the spectral rule
def compute(self, admat, features):
    '  '
    self.D = torch.diag(admat.sum(1), diagonal=0)
    self.out = torch.empty(admat.size[0], self.op_size)
    self.a_hat = (admat + torch.eye(admat.size[0]))
    self.D_inv = (self.D ** (- 0.5))
    self.a_hat = ((self.D_inv * self.a_hat) * self.D_inv)
    self.out = torch.dot(torch.dot(self.a_hat, features), self.weights)
    return self.out