class_docstr: Base class for hooks based on summary metrics.
  
  Subclasses should override _process_metrics.
  
  If _process_metrics returns True, calls run_context.request_stop().
  
  This can be used to something like "Stop after the loss has stopped decreasing
  for 5000 steps.
code: def begin(self):
      self._global_step_tensor = tf.train.get_global_step()
      if self._global_step_tensor is None:
          raise RuntimeError(
              "Global step must be created to use MetricsBasedHook."
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tensorflow.compat.v1
  from tensorboard.backend.event_processing import event_accumulator
  from tensorboard.backend.event_processing import event_multiplexer
label_desc: Use image node_id 3 for calling the MetricsBasedHook obj's underlying member method code with example usage: obj.begin() without return types