code: def sigmoid_loss(config, predictions):
      """doc"""
      log.info("use sigmoid loss")
      logits = paddle.unsqueeze(predictions["logits"], axis=1)
  
      pos_label = paddle.full(
          shape=[paddle.shape(logits)[0], 1, 1],
          dtype="float32",
          fill_value=1.0,
      )
      neg_label = paddle.full(
          shape=[paddle.shape(logits)[0], 1, config.neg_num],
          dtype="float32",
          fill_value=0.0,
      )
      label = paddle.concat([pos_label, neg_label], -1)
  
      pos_weight = paddle.full(
          shape=[paddle.shape(logits)[0], 1, 1],
          dtype="float32",
          fill_value=config.neg_num,
      )
      neg_weight = paddle.full(
          shape=[paddle.shape(logits)[0], 1, 1],
          dtype="float32",
          fill_value=1.0,
      )
      weight = paddle.concat([pos_weight, neg_weight], -1)
  
      weight.stop_gradient = True
      label.stop_gradient = True
  
      loss = paddle.nn.functional.binary_cross_entropy_with_logits(
          logits, label
      )
      loss = loss * weight
      loss = paddle.sum(loss)
  
      return loss
  
file_path: PGL/apps/PGLBox/src/models/loss.py
imports: import os
  import sys
  import math
  import time
  import numpy
  import pickle
  import paddle
  import paddle.static
  import paddle.fluid
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling a global function with example usage: sigmoid_loss(config, predictions) and returns: loss