code: def softmax_neg(self, X):
      hm = 1.0 - torch.eye(*X.shape, out=torch.empty_like(X))
      X = X * hm
      e_x = torch.exp(X - X.max(dim=1, keepdim=True)[0]) * hm
      return e_x / e_x.sum(dim=1, keepdim=True)
  
imports: from collections import Counter
  import numpy
  import torch
  from torch import nn
  from torch.autograd import Variable
  from torch.optim import Optimizer
  from cornac.utils.common import get_rng
label_desc: Use image node_id 5 for calling the GRU4RecModel obj's underlying member method code with example usage: obj.softmax_neg(X) and returns: unknown