code: def numpy_normalised_quantile_loss(y, y_pred, quantile):
      """Computes normalised quantile loss for numpy arrays.
  
      Uses the q-Risk metric as defined in the "Training Procedure" section of the
      main TFT paper.
  
      Args:
        y: Targets
        y_pred: Predictions
        quantile: Quantile to use for loss calculations (between 0 & 1)
  
      Returns:
        Float for normalised quantile loss.
      """
      prediction_underflow = y - y_pred
      weighted_errors = quantile * np.maximum(
          prediction_underflow, 0.0
      ) + (1.0 - quantile) * np.maximum(-prediction_underflow, 0.0)
  
      quantile_loss = weighted_errors.mean()
      normaliser = y.abs().mean()
  
      return 2 * quantile_loss / normaliser
  
file_path: qlib/examples/benchmarks/TFT/libs/utils.py
imports: import os
  import pathlib
  import numpy
  import tensorflow
  from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
label_desc: Use image node_id 4 for calling a global function with example usage: numpy_normalised_quantile_loss(y, y_pred, quantile) and returns: unknown