pytorch_forecasting.metrics.
NegativeBinomialDistributionLoss
Bases: pytorch_forecasting.metrics.DistributionLoss
pytorch_forecasting.metrics.DistributionLoss
Negative binomial loss, e.g. for count data.
not centered normalization (only rescaled)
Optional: Use eps=1 if you are dealing with count data
eps=1
Initialize metric
name (str) – metric name. Defaults to class name.
quantiles (List[float], optional) – quantiles for probability range. Defaults to None.
reduction (str, optional) – Reduction, “none”, “mean” or “sqrt-mean”. Defaults to “mean”.
Methods
map_x_to_distribution(x)
map_x_to_distribution
Map the a tensor of parameters to a probability distribution.
rescale_parameters(parameters, target_scale, …)
rescale_parameters
Rescale normalized parameters into the scale required for the distribution.
Attributes
distribution_arguments
distribution_class
alias of torch.distributions.negative_binomial.NegativeBinomial
torch.distributions.negative_binomial.NegativeBinomial
x (torch.Tensor) – parameters for probability distribution. Last dimension will index the parameters
class attribute distribution_class
distributions.Distribution
[extended_summary]
parameters (torch.Tensor) – normalized parameters (indexed by last dimension)
target_scale (torch.Tensor) – scale of parameters (n_batch_samples x (center, scale))
transformer (BaseEstimator) – original transformer that normalized the target in the first place
parameters in real/not normalized space
torch.Tensor