code: def optimizer(self):
      assert (
          self.mode == "train"
      ), "optimizer only can be get in train mode"
      epoch_points = [self.num_epochs / 3, self.num_epochs * 2 / 3]
      total_videos = self.total_videos
      step = int(total_videos / self.batch_size + 1)
      bd = [e * step for e in epoch_points]
      base_lr = self.base_learning_rate
      lr_decay = self.learning_rate_decay
      lr = [base_lr, base_lr * lr_decay, base_lr * lr_decay * lr_decay]
      l2_weight_decay = self.l2_weight_decay
      momentum = self.momentum
      optimizer = fluid.optimizer.Momentum(
          learning_rate=fluid.layers.piecewise_decay(
              boundaries=bd, values=lr
          ),
          momentum=momentum,
          regularization=fluid.regularizer.L2Decay(l2_weight_decay),
      )
  
      return optimizer
  
imports: import numpy
  import paddle.fluid
  from paddle.fluid import ParamAttr
  from ..model import ModelBase
  from .tsn_res_model import TSN_ResNet
  import logging
label_desc: Use image node_id 6 for calling the TSN obj's underlying member method code with example usage: obj.optimizer() and returns: optimizer