class_docstr: Implicit Quantile Network Distribution Loss.
  
  Based on `Probabilistic Time Series Forecasting with Implicit Quantile Networks
  <https://arxiv.org/pdf/2107.03743.pdf>`_.
  A network is used to directly map network outputs to a quantile.
class_docstr_tok: ["Implicit","Quantile","Network","Distribution","Loss",".","Based","on","`","Probabilistic","Time","Series","Forecasting","with","Implicit","Quantile","Networks","<","https",":","\/\/arxiv.org\/pdf\/2107.03743.pdf",">","`","_",".","A","network","is","used","to","directly","map","network","outputs","to","a","quantile","."]
code: def sample(self, y_pred, n_samples: int) -> torch.Tensor:
      eps = 1e-3
      # for a couple of random quantiles (excl. 0 and 1 as they would lead to infinities)
      quantiles = torch.rand(
          size=(n_samples,), device=y_pred.device
      ).clamp(eps, 1 - eps)
      # make prediction
      samples = self.to_quantiles(y_pred, quantiles=quantiles)
      return samples
  
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 2 for calling the ImplicitQuantileNetworkDistributionLoss obj's underlying member method code with example usage: obj.sample(y_pred, n_samples) and returns: samples