class_docstr: Negative binomial loss, e.g. for count data.
  
  Requirements for original target normalizer:
      * not centered normalization (only rescaled)
class_docstr_tok: ["Negative","binomial","loss",",","e.g",".","for","count","data",".","Requirements","for","original","target","normalizer",":","*","not","centered","normalization","(","only","rescaled",")"]
code: def map_x_to_distribution(
      self, x: torch.Tensor
  ) -> distributions.NegativeBinomial:
      mean = x[..., 0]
      shape = x[..., 1]
      r = 1.0 / shape
      p = mean / (mean + r)
      return self.distribution_class(total_count=r, probs=p)
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from sklearn.base import BaseEstimator
  import torch
  from torch import distributions, nn
  import torch.nn.functional
  from pytorch_forecasting.data.encoders import TorchNormalizer, softplus_inv
  from pytorch_forecasting.metrics.base_metrics import DistributionLoss, MultivariateDistributionLoss
label_desc: Use image node_id 1 for calling the NegativeBinomialDistributionLoss obj's underlying member method code with example usage: obj.map_x_to_distribution(x) and returns: self