class_docstr: Implementation of the Negative Cosine Simililarity used in the SimSiam[0] paper.
  
  [0] SimSiam, 2020, https://arxiv.org/abs/2011.10566
  
  Examples:
  
      >>> # initialize loss function
      >>> loss_fn = NegativeCosineSimilarity()
      >>>
      >>> # generate two representation tensors
      >>> # with batch size 10 and dimension 128
      >>> x0 = torch.randn(10, 128)
      >>> x1 = torch.randn(10, 128)
      >>>
      >>> # calculate loss
      >>> loss = loss_fn(x0, x1)
class_docstr_tok: ["Implementation","of","the","Negative","Cosine","Simililarity","used","in","the","SimSiam","[","0","]","paper",".","[","0","]","SimSiam",",","2020",",","https",":","\/\/arxiv.org\/abs\/2011.10566","Examples",":",">",">",">","#","initialize","loss","function",">",">",">","loss_fn","=","NegativeCosineSimilarity","(",")",">",">",">",">",">",">","#","generate","two","representation","tensors",">",">",">","#","with","batch","size","10","and","dimension","128",">",">",">","x0","=","torch.randn","(","10",",","128",")",">",">",">","x1","=","torch.randn","(","10",",","128",")",">",">",">",">",">",">","#","calculate","loss",">",">",">","loss","=","loss_fn","(","x0",",","x1",")"]
docstr: Same parameters as in torch.nn.CosineSimilarity
  
  Args:
      dim (int, optional):
          Dimension where cosine similarity is computed. Default: 1
      eps (float, optional):
          Small value to avoid division by zero. Default: 1e-8
docstr_tok: ["Same","parameters","as","in","torch.nn.CosineSimilarity","Args",":","dim","(","int",",","optional",")",":","Dimension","where","cosine","similarity","is","computed",".","Default",":","1","eps","(","float",",","optional",")",":","Small","value","to","avoid","division","by","zero",".","Default",":","1e-8"]
code: def __init__(self, dim: int = 1, eps: float = 1e-8) -> None:
      """Same parameters as in torch.nn.CosineSimilarity
  
      Args:
          dim (int, optional):
              Dimension where cosine similarity is computed. Default: 1
          eps (float, optional):
              Small value to avoid division by zero. Default: 1e-8
      """
      super().__init__()
      self.dim = dim
      self.eps = eps
  
imports: import torch
  from torch.nn.functional import cosine_similarity
label_desc: Use image node_id 1 to create a new NegativeCosineSimilarity object from inherited base classes: torch.nn with example: obj = NegativeCosineSimilarity(dim, eps)