code: def instantiate_bn_scheduler(model, bn_scheduler_opt):
      """Return a batch normalization scheduler
      Parameters:
          model          -- the nn network
          bn_scheduler_opt (option class) -- dict containing all the params to build the scheduler
                                opt.bn_policy is the name of learning rate policy: lambda_rule | step | plateau | cosine
                                opt.params contains the scheduler_params to construct the scheduler
      See https://pytorch.org/docs/stable/optim.html for more details.
      """
      update_scheduler_on = bn_scheduler_opt.get("update_scheduler_on")
      bn_scheduler_params = bn_scheduler_opt.get("params")
      if bn_scheduler_opt.get("bn_policy") == "step_decay":
          bn_lambda = lambda e: max(
              bn_scheduler_params.bn_momentum
              * bn_scheduler_params.bn_decay
              ** (int(e // bn_scheduler_params.decay_step)),
              bn_scheduler_params.bn_clip,
          )
  
      else:
          return NotImplementedError(
              "bn_policy [%s] is not implemented",
              bn_scheduler_opt.bn_policy,
          )
  
      bn_scheduler = BNMomentumScheduler(
          model, bn_lambda, update_scheduler_on
      )
      bn_scheduler.scheduler_opt = OmegaConf.to_container(
          bn_scheduler_opt
      )
      return bn_scheduler
  
file_path: torch-points3d/torch_points3d/core/schedulers/bn_schedulers.py
imports: from typing import *
  from omegaconf import OmegaConf
  from torch import nn
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: instantiate_bn_scheduler(model, bn_scheduler_opt) and returns: bn_scheduler, NotImplementedError