class_docstr: Distribution class for the Incremental (Spline) Quantile Function in the
  paper ``Learning Quantile Functions without Quantile Crossing for
  Distribution-free Time Series Forecasting``
  by Park, Robinson, Aubet, Kan, Gasthaus, Wang
  Parameters
  ----------
  spline_knots, spline_heights
      Tensor parametrizing the x-positions (y-positions) of the spline knots
      Shape: (*batch_shape, (num_qk-1), num_pieces)
  qk_x, qk_y
      Tensor containing the increasing x-positions (y-positions) of the
      quantile knots, Shape: (*batch_shape, num_qk)
  beta_l, beta_r
      Tensor containing the non-negative learnable parameter of the
      left (right) tail, Shape: (*batch_shape,)
class_docstr_tok: ["Distribution","class","for","the","Incremental","(","Spline",")","Quantile","Function","in","the","paper","``","Learning","Quantile","Functions","without","Quantile","Crossing","for","Distribution-free","Time","Series","Forecasting","``","by","Park",",","Robinson",",","Aubet",",","Kan",",","Gasthaus",",","Wang","Parameters","--","--","--","--","--","spline_knots",",","spline_heights","Tensor","parametrizing","the","x-positions","(","y-positions",")","of","the","spline","knots","Shape",":","(","*","batch_shape",",","(","num_qk-1",")",",","num_pieces",")","qk_x",",","qk_y","Tensor","containing","the","increasing","x-positions","(","y-positions",")","of","the","quantile","knots",",","Shape",":","(","*","batch_shape",",","num_qk",")","beta_l",",","beta_r","Tensor","containing","the","non-negative","learnable","parameter","of","the","left","(","right",")","tail",",","Shape",":","(","*","batch_shape",",",")"]
docstr: Function to parameterize the tail parameters
  Note that the exponential tails are given by
  q(alpha)
  = a_l log(alpha) + b_l if left tail
  = a_r log(1-alpha) + b_r if right tail
  where
  a_l=1/beta_l, b_l=-a_l*log(qk_x_l)+q(qk_x_l)
  a_r=1/beta_r, b_r=a_r*log(1-qk_x_r)+q(qk_x_r)
  Parameters
  ----------
  beta
      parameterizes the left or right tail, shape: (*batch_shape,)
  qk_x
      left- or right-most x-positions of the quantile knots,
      shape: (*batch_shape,)
  qk_y
      left- or right-most y-positions of the quantile knots,
      shape: (*batch_shape,)
  Returns
  -------
  tail_a
      a_l or a_r as described above
  tail_b
      b_l or b_r as described above
docstr_tok: ["Function","to","parameterize","the","tail","parameters","Note","that","the","exponential","tails","are","given","by","q","(","alpha",")","=","a_l","log","(","alpha",")","+","b_l","if","left","tail","=","a_r","log","(","1-alpha",")","+","b_r","if","right","tail","where","a_l=1\/beta_l",",","b_l=-a_l","*","log","(","qk_x_l",")","+q","(","qk_x_l",")","a_r=1\/beta_r",",","b_r=a_r","*","log","(","1-qk_x_r",")","+q","(","qk_x_r",")","Parameters","--","--","--","--","--","beta","parameterizes","the","left","or","right","tail",",","shape",":","(","*","batch_shape",",",")","qk_x","left-","or","right-most","x-positions","of","the","quantile","knots",",","shape",":","(","*","batch_shape",",",")","qk_y","left-","or","right-most","y-positions","of","the","quantile","knots",",","shape",":","(","*","batch_shape",",",")","Returns","--","--","--","-","tail_a","a_l","or","a_r","as","described","above","tail_b","b_l","or","b_r","as","described","above"]
code: def parameterize_tail(
      beta: torch.Tensor, qk_x: torch.Tensor, qk_y: torch.Tensor
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      r"""
      Function to parameterize the tail parameters
      Note that the exponential tails are given by
      q(alpha)
      = a_l log(alpha) + b_l if left tail
      = a_r log(1-alpha) + b_r if right tail
      where
      a_l=1/beta_l, b_l=-a_l*log(qk_x_l)+q(qk_x_l)
      a_r=1/beta_r, b_r=a_r*log(1-qk_x_r)+q(qk_x_r)
      Parameters
      ----------
      beta
          parameterizes the left or right tail, shape: (*batch_shape,)
      qk_x
          left- or right-most x-positions of the quantile knots,
          shape: (*batch_shape,)
      qk_y
          left- or right-most y-positions of the quantile knots,
          shape: (*batch_shape,)
      Returns
      -------
      tail_a
          a_l or a_r as described above
      tail_b
          b_l or b_r as described above
      """
  
      tail_a = 1 / beta
      tail_b = -tail_a * torch.log(qk_x) + qk_y
  
      return tail_a, tail_b
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch.distributions import AffineTransform, TransformedDistribution
  from gluonts.core.component import validated
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 4 for calling the ISQF obj's underlying member method code with example usage: obj.parameterize_tail(beta, qk_x, qk_y) and returns: tail_a,  tail_b