class_docstr: The Graph Auto-Encoder model from the
  `"Variational Graph Auto-Encoders" <https://arxiv.org/abs/1611.07308>`_
  paper based on user-defined encoder and decoder models.
  
  Args:
      encoder (torch.nn.Module): The encoder module.
      decoder (torch.nn.Module, optional): The decoder module. If set to
          :obj:`None`, will default to the
          :class:`torch_geometric.nn.models.InnerProductDecoder`.
          (default: :obj:`None`)
class_docstr_tok: ["The","Graph","Auto-Encoder","model","from","the","`","``","Variational","Graph","Auto-Encoders","''","<","https",":","\/\/arxiv.org\/abs\/1611.07308",">","`","_","paper","based","on","user-defined","encoder","and","decoder","models",".","Args",":","encoder","(","torch.nn.Module",")",":","The","encoder","module",".","decoder","(","torch.nn.Module",",","optional",")",":","The","decoder","module",".","If","set","to",":","obj",":","`","None","`",",","will","default","to","the",":","class",":","`","torch_geometric.nn.models.InnerProductDecoder","`",".","(","default",":",":","obj",":","`","None","`",")"]
docstr: Given latent variables :obj:`z`, computes the binary cross
  entropy loss for positive edges :obj:`pos_edge_index` and negative
  sampled edges.
  
  Args:
      z (torch.Tensor): The latent space :math:`\mathbf{Z}`.
      pos_edge_index (torch.Tensor): The positive edges to train against.
      neg_edge_index (torch.Tensor, optional): The negative edges to
          train against. If not given, uses negative sampling to
          calculate negative edges. (default: :obj:`None`)
docstr_tok: ["Given","latent","variables",":","obj",":","`","z","`",",","computes","the","binary","cross","entropy","loss","for","positive","edges",":","obj",":","`","pos_edge_index","`","and","negative","sampled","edges",".","Args",":","z","(","torch.Tensor",")",":","The","latent","space",":","math",":","`","\\mathbf","{","Z","}","`",".","pos_edge_index","(","torch.Tensor",")",":","The","positive","edges","to","train","against",".","neg_edge_index","(","torch.Tensor",",","optional",")",":","The","negative","edges","to","train","against",".","If","not","given",",","uses","negative","sampling","to","calculate","negative","edges",".","(","default",":",":","obj",":","`","None","`",")"]
code: def recon_loss(
      self,
      z: Tensor,
      pos_edge_index: Tensor,
      neg_edge_index: Optional[Tensor] = None,
  ) -> Tensor:
      r"""Given latent variables :obj:`z`, computes the binary cross
      entropy loss for positive edges :obj:`pos_edge_index` and negative
      sampled edges.
  
      Args:
          z (torch.Tensor): The latent space :math:`\mathbf{Z}`.
          pos_edge_index (torch.Tensor): The positive edges to train against.
          neg_edge_index (torch.Tensor, optional): The negative edges to
              train against. If not given, uses negative sampling to
              calculate negative edges. (default: :obj:`None`)
      """
      pos_loss = -torch.log(
          self.decoder(z, pos_edge_index, sigmoid=True) + EPS
      ).mean()
  
      if neg_edge_index is None:
          neg_edge_index = negative_sampling(pos_edge_index, z.size(0))
      neg_loss = -torch.log(
          1 - self.decoder(z, neg_edge_index, sigmoid=True) + EPS
      ).mean()
  
      return pos_loss + neg_loss
  
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torch_geometric.nn.inits import reset
  from torch_geometric.utils import negative_sampling
label_desc: Use image node_id 6 for calling the GAE obj's underlying member method code with example usage: obj.recon_loss(z, pos_edge_index, neg_edge_index) and returns: unknown