class_docstr: Class defining binary distribution type functionality
docstr: https://pytorch.org/docs/stable/nn.html#torch.nn.BCEWithLogitsLoss
  Uses the functional implementation of the BCEWithLogitsLoss class.
  
  The average logit binary cross entropy loss.
  Averages across sample dimension (dim=0).
  
  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\/stable\/nn.html","#","torch.nn.BCEWithLogitsLoss","Uses","the","functional","implementation","of","the","BCEWithLogitsLoss","class",".","The","average","logit","binary","cross","entropy","loss",".","Averages","across","sample","dimension","(","dim=0",")",".","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/stable/nn.html#torch.nn.BCEWithLogitsLoss
      Uses the functional implementation of the BCEWithLogitsLoss class.
  
      The average logit binary cross entropy loss.
      Averages across sample dimension (dim=0).
  
      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.binary_cross_entropy_with_logits(
          input=X_hat[:, self.idx],
          target=X[:, self.idx],
          reduction="mean",
      )
  
imports: import torch
  from torch import nn
  from causalnex.structure.pytorch.dist_type._base import DistTypeBase
label_desc: Use image node_id 1 for calling the DistTypeBinary obj's underlying member method code with example usage: obj.loss(X, X_hat) and returns: nn