code: def adopt_weight(weight, global_step, threshold=0, value=0.0):
      if global_step < threshold:
          weight = value
      return weight
  
file_path: compvis-stable-diffusion/ldm/modules/losses/vqperceptual.py
imports: import torch
  from torch import nn
  import torch.nn.functional
  from einops import repeat
  from taming.modules.discriminator.model import NLayerDiscriminator, weights_init
  from taming.modules.losses.lpips import LPIPS
  from taming.modules.losses.vqperceptual import hinge_d_loss, vanilla_d_loss
label_desc: Use image node_id 2 for calling a global function with example usage: adopt_weight(weight, global_step, threshold, value) and returns: weight