class_docstr: Class defining poisson distribution type functionality
docstr: https://pytorch.org/docs/master/generated/torch.nn.PoissonNLLLoss.html
  Uses the functional implementation of the PoissonNLL class.
  Returns the elementwise Poisson Negative Log Likelihood loss.
  
  Args:
      X: The original data passed into NOTEARS (i.e. the reconstruction target).
  
      X_hat: The reconstructed data.
  
  Returns:
      Scalar pytorch tensor of the reconstruction loss between X and X_hat.
docstr_tok: ["https",":","\/\/pytorch.org\/docs\/master\/generated\/torch.nn.PoissonNLLLoss.html","Uses","the","functional","implementation","of","the","PoissonNLL","class",".","Returns","the","elementwise","Poisson","Negative","Log","Likelihood","loss",".","Args",":","X",":","The","original","data","passed","into","NOTEARS","(","i.e",".","the","reconstruction","target",")",".","X_hat",":","The","reconstructed","data",".","Returns",":","Scalar","pytorch","tensor","of","the","reconstruction","loss","between","X","and","X_hat","."]
code: def loss(self, X: torch.Tensor, X_hat: torch.Tensor) -> torch.Tensor:
      """
      https://pytorch.org/docs/master/generated/torch.nn.PoissonNLLLoss.html
      Uses the functional implementation of the PoissonNLL class.
      Returns the elementwise Poisson Negative Log Likelihood loss.
  
      Args:
          X: The original data passed into NOTEARS (i.e. the reconstruction target).
  
          X_hat: The reconstructed data.
  
      Returns:
          Scalar pytorch tensor of the reconstruction loss between X and X_hat.
      """
      return nn.functional.poisson_nll_loss(
          input=X_hat[:, self.idx],
          target=X[:, self.idx],
          reduction="mean",
          log_input=True,
          full=False,
      )
  
file_path: causalnex/causalnex/structure/pytorch/dist_type/poisson.py
imports: import numpy
  import torch
  from torch import nn
  from causalnex.structure.pytorch.dist_type._base import DistTypeBase
label_desc: Use image node_id 2 for calling the DistTypePoisson obj's underlying member method code with example usage: obj.loss(X, X_hat) and returns: nn