code: def forward(self, pos_u, pos_v, neg_v):
      emb_u = self.u_embeddings(pos_u)
      emb_v = self.v_embeddings(pos_v)
      emb_neg_v = self.v_embeddings(neg_v)
  
      score = torch.sum(torch.mul(emb_u, emb_v), dim=1)
      score = torch.clamp(score, max=10, min=-10)
      score = -F.logsigmoid(score)
  
      neg_score = torch.bmm(emb_neg_v, emb_u.unsqueeze(2)).squeeze()
      neg_score = torch.clamp(neg_score, max=10, min=-10)
      neg_score = -torch.sum(F.logsigmoid(-neg_score), dim=1)
  
      return torch.mean(score + neg_score)
  
file_path: dgl/examples/pytorch/metapath2vec/model.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import init
label_desc: Use image node_id 2 for calling the SkipGramModel obj's underlying member method code with example usage: obj.forward(pos_u, pos_v, neg_v) and returns: torch