class_docstr: Implementation of the Symmetrized Loss used in the SimSiam[0] paper.
  
  [0] SimSiam, 2020, https://arxiv.org/abs/2011.10566
  
  Examples:
  
      >>> # initialize loss function
      >>> loss_fn = SymNegCosineSimilarityLoss()
      >>>
      >>> # generate two random transforms of images
      >>> t0 = transforms(images)
      >>> t1 = transforms(images)
      >>>
      >>> # feed through SimSiam model
      >>> out0, out1 = model(t0, t1)
      >>>
      >>> # calculate loss
      >>> loss = loss_fn(out0, out1)
class_docstr_tok: ["Implementation","of","the","Symmetrized","Loss","used","in","the","SimSiam","[","0","]","paper",".","[","0","]","SimSiam",",","2020",",","https",":","\/\/arxiv.org\/abs\/2011.10566","Examples",":",">",">",">","#","initialize","loss","function",">",">",">","loss_fn","=","SymNegCosineSimilarityLoss","(",")",">",">",">",">",">",">","#","generate","two","random","transforms","of","images",">",">",">","t0","=","transforms","(","images",")",">",">",">","t1","=","transforms","(","images",")",">",">",">",">",">",">","#","feed","through","SimSiam","model",">",">",">","out0",",","out1","=","model","(","t0",",","t1",")",">",">",">",">",">",">","#","calculate","loss",">",">",">","loss","=","loss_fn","(","out0",",","out1",")"]
code: def _neg_cosine_simililarity(self, x, y):
      v = -torch.nn.functional.cosine_similarity(
          x, y.detach(), dim=-1
      ).mean()
      return v
  
imports: import warnings
  import torch
label_desc: Use image node_id 2 for calling the SymNegCosineSimilarityLoss obj's underlying member method code with example usage: obj._neg_cosine_simililarity(x, y) and returns: v