class_docstr: y_range: Used specifically for regression. = None for classification.
class_docstr_tok: ["y_range",":","Used","specifically","for","regression",".","=","None","for","classification","."]
code: def margin_loss(self, input_data, margin_scale=0.0001):
      # number of samples
      batch_size, num_quantiles = input_data.size()
  
      # compute margin loss (batch_size x num_net_outputs(above) x num_net_outputs(below))
      error_data = input_data.unsqueeze(1) - input_data.unsqueeze(2)
  
      # margin data (num_quantiles x num_quantiles)
      margin_data = (
          self.quantile_levels.permute(1, 0) - self.quantile_levels
      )
      margin_data = torch.tril(margin_data, -1) * margin_scale
  
      # compute accumulated margin
      loss_data = torch.tril(error_data + margin_data, diagonal=-1)
      loss_data = loss_data.relu()
      loss_data = loss_data.sum() / float(
          batch_size
          * (num_quantiles * num_quantiles - num_quantiles)
          * 0.5
      )
      return loss_data
  
file_path: autogluon/tabular/src/autogluon/tabular/models/tabular_nn/torch/torch_network_modules.py
imports: import logging
  import numpy
  import torch
  import torch.nn
  from autogluon.core.constants import BINARY, MULTICLASS, QUANTILE, REGRESSION, SOFTCLASS
  from ..utils.nn_architecture_utils import get_embed_sizes
label_desc: Use image node_id 6 for calling the EmbedNet obj's underlying member method code with example usage: obj.margin_loss(input_data, margin_scale) and returns: loss_data