class_docstr: Zero And One Inflated Beta distribution as in Raydonal Ospina, Silvia L.P.
  Ferrari: Inflated Beta Distributions
  
  Parameters
  ----------
  alpha
      Tensor containing the alpha shape parameters, of shape
      `(*batch_shape, *event_shape)`.
  beta
      Tensor containing the beta shape parameters, of shape
      `(*batch_shape, *event_shape)`.
  zero_probability
      Tensor containing the probability of zeros, of shape
      `(*batch_shape, *event_shape)`.
  one_probability
      Tensor containing the probability of ones, of shape
      `(*batch_shape, *event_shape)`.
  F
class_docstr_tok: ["Zero","And","One","Inflated","Beta","distribution","as","in","Raydonal","Ospina",",","Silvia","L.P.","Ferrari",":","Inflated","Beta","Distributions","Parameters","--","--","--","--","--","alpha","Tensor","containing","the","alpha","shape","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","beta","Tensor","containing","the","beta","shape","parameters",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","zero_probability","Tensor","containing","the","probability","of","zeros",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","one_probability","Tensor","containing","the","probability","of","ones",",","of","shape","`","(","*","batch_shape",",","*","event_shape",")","`",".","F"]
code: def log_prob(self, x: Tensor) -> Tensor:
      F = self.F
  
      # mask zeros for the Beta distribution input to prevent NaN gradients
      inputs = F.where(
          F.broadcast_logical_or(x == 0, x == 1),
          x.zeros_like() + 0.5,
          x,
      )
  
      # compute log density, case by case
      return F.where(
          x == 1,
          F.log(self.one_probability.broadcast_like(x)),
          F.where(
              x == 0,
              F.log(self.zero_probability.broadcast_like(x)),
              F.log(self.beta_probability)
              + self.beta_distribution.log_prob(inputs),
          ),
      )
  
imports: from typing import Dict, Tuple
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from .beta import Beta
  from .deterministic import Deterministic
  from .distribution import getF, softplus
  from .distribution_output import DistributionOutput
  from .mixture import MixtureDistribution
label_desc: Use image node_id 2 for calling the ZeroAndOneInflatedBeta obj's underlying member method code with example usage: obj.log_prob(x) and returns: F