code: def optimization(base_lr, loss, optimizer="adam"):
      if optimizer == "sgd":
          optimizer = F.optimizer.SGD(base_lr)
      elif optimizer == "adam":
          optimizer = F.optimizer.Adam(base_lr, lazy_mode=True)
      else:
          raise ValueError
  
      log.info("learning rate:%f" % (base_lr))
      # create the DistributeTranspiler configure
      config = DistributeTranspilerConfig()
      config.sync_mode = False
      # config.runtime_split_send_recv = False
  
      config.slice_var_up = False
      # create the distributed optimizer
      optimizer = fleet.distributed_optimizer(optimizer, config)
      optimizer.minimize(loss)
  
file_path: PGL/legacy/examples/distribute_graphsage/cluster_train.py
imports: import argparse
  import time
  import os
  import math
  import numpy
  import paddle.fluid
  import paddle.fluid.layers
  from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
  from paddle.fluid.transpiler.distribute_transpiler import DistributeTranspilerConfig
  import paddle.fluid.incubate.fleet.base.role_maker
  from pgl.utils.logger import log
  from model import GraphsageModel
  from utils import load_config
  import reader
label_desc: Use image node_id 2 for calling a global function with example usage: optimization(base_lr, loss, optimizer) without return types