class_docstr: One subclass of :class:`ModelDescBase` with the assupmtion of
  **single cost** and **single optimizer** training.
  It has the following constraints in addition to :class:`ModelDescBase`:
  
  1. `build_graph(...)` method should return a cost tensor when called under a training context.
     The cost will be the final cost to be optimized by the optimizer.
     Therefore it should include necessary regularization.
  
  2. Subclass is expected to implement :meth:`optimizer()` method.
docstr: A subclass is expected to implement this method.
  
  Returns:
      a `tf.train.Optimizer` instance.
docstr_tok: ["A","subclass","is","expected","to","implement","this","method",".","Returns",":","a","`","tf.train.Optimizer","`","instance","."]
code: def optimizer(self):
      """
      A subclass is expected to implement this method.
  
      Returns:
          a `tf.train.Optimizer` instance.
      """
      raise NotImplementedError()
  
file_path: tensorpack/tensorpack/train/model_desc.py
imports: import tensorflow
  from ..utils.argtools import memoized_method
  from ..tfutils.common import get_op_tensor_name
  from ..tfutils.tower import get_current_tower_context
  from ..compat import _backport_tensor_spec, tfv1
label_desc: Use image node_id 2 for calling the ModelDesc obj's underlying member method code with example usage: obj.optimizer() without return types