class_docstr: Distribution class for the model MQF2 proposed in the paper
  ``Multivariate Quantile Function Forecaster``
  by Kan, Aubet, Januschowski, Park, Benidis, Ruthotto, Gasthaus
  Parameters
  ----------
  picnn
      A SequentialNet instance of a
      partially input convex neural network (picnn)
  hidden_state
      hidden_state obtained by unrolling the RNN encoder
      shape = (batch_size, context_length, hidden_size) in training
      shape = (batch_size, hidden_size) in inference
  prediction_length
      Length of the prediction horizon
  is_energy_score
      If True, use energy score as objective function
      otherwise use maximum likelihood as
      objective function (normalizing flows)
  es_num_samples
      Number of samples drawn to approximate the energy score
  beta
      Hyperparameter of the energy score (power of the two terms)
  threshold_input
      Clamping threshold of the (scaled) input when maximum
      likelihood is used as objective function
      this is used to make the forecaster more robust
      to outliers in training samples
  validate_args
      Sets whether validation is enabled or disabled
      For more details, refer to the descriptions in
      torch.distributions.distribution.Distribution
code: def __init__(
      self,
      picnn: torch.nn.Module,
      hidden_state: torch.Tensor,
      prediction_length: int,
      is_energy_score: bool = True,
      es_num_samples: int = 50,
      beta: float = 1.0,
      threshold_input: float = 100.0,
      validate_args: bool = False,
  ) -> None:
      self.picnn = picnn
      self.hidden_state = hidden_state
      self.prediction_length = prediction_length
      self.is_energy_score = is_energy_score
      self.es_num_samples = es_num_samples
      self.beta = beta
      self.threshold_input = threshold_input
  
      super().__init__(
          batch_shape=self.batch_shape, validate_args=validate_args
      )
  
      self.context_length = (
          self.hidden_state.shape[-2]
          if len(self.hidden_state.shape) > 2
          else 1
      )
      self.numel_batch = self.get_numel(self.batch_shape)
  
      # mean zero and std one
      mu = torch.tensor(
          0, dtype=hidden_state.dtype, device=hidden_state.device
      )
      sigma = torch.ones_like(mu)
      self.standard_normal = Normal(mu, sigma)
  
imports: from typing import List, Optional, Tuple
  from cpflows.flows import DeepConvexFlow, SequentialFlow
  import torch
  from torch.distributions import AffineTransform, Distribution, Normal, TransformedDistribution
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new MQF2Distribution object from inherited base classes: Distribution with example: obj = MQF2Distribution(picnn, hidden_state, prediction_length, is_energy_score, es_num_samples, beta, threshold_input, validate_args)