code: def true_positives_lower_bound(labels, logits, weights):
      """
      true_positives_lower_bound defined in paper:
      "Scalable Learning of Non-Decomposable Objectives"
  
      Args:
          labels: A `Tensor` of shape broadcastable to logits.
          logits: A `Tensor` of shape [N, C] or [N, C, K].
              If the third dimension is present,
              the lower bound is computed on each slice [:, :, k] independently.
          weights: Per-example loss coefficients, with shape [N, 1] or [N, C]
  
      Returns:
          A `Tensor` of shape [C] or [C, K].
      """
      # A `Tensor` of shape [N, C] or [N, C, K]
      loss_on_positives = weighted_hinge_loss(
          labels, logits, negative_weights=0.0
      )
  
      weighted_loss_on_positives = (
          weights.unsqueeze(-1) * (labels - loss_on_positives)
          if loss_on_positives.dim() > weights.dim()
          else weights * (labels - loss_on_positives)
      )
      return weighted_loss_on_positives.sum(0)
  
file_path: pytext/pytext/utils/loss.py
imports: import numpy
  import torch
  from .cuda import FloatTensor
label_desc: Use image node_id 4 for calling a global function with example usage: true_positives_lower_bound(labels, logits, weights) and returns: weighted_loss_on_positives