class_docstr: Trigger invoked when key value getting bigger or lower than before.
  
  Args:
      key (str) : Key of value.
      compare_fn ((float, float) -> bool) : Function to compare the values.
      trigger (tuple(int, str)) : Trigger that decide the comparison interval.
class_docstr_tok: ["Trigger","invoked","when","key","value","getting","bigger","or","lower","than","before",".","Args",":","key","(","str",")",":","Key","of","value",".","compare_fn","(","(","float",",","float",")","-",">","bool",")",":","Function","to","compare","the","values",".","trigger","(","tuple","(","int",",","str",")",")",":","Trigger","that","decide","the","comparison","interval","."]
docstr: Get value related to the key and compare with current value.
docstr_tok: ["Get","value","related","to","the","key","and","compare","with","current","value","."]
code: def __call__(self, trainer):
      """Get value related to the key and compare with current value."""
      observation = trainer.observation
      summary = self._summary
      key = self._key
      if key in observation:
          summary.add({key: observation[key]})
  
      if not self._interval_trigger(trainer):
          return False
  
      stats = summary.compute_mean()
      value = float(stats[key])  # copy to CPU
      self._init_summary()
  
      if self._best_value is None:
          # initialize best value
          self._best_value = value
          return False
      elif self._compare_fn(self._best_value, value):
          return True
      else:
          self._best_value = value
          return False
  
imports: import argparse
  import copy
  import json
  import logging
  import os
  import shutil
  import tempfile
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the CompareValueTrigger obj's underlying member method code with example usage: obj.__call__(trainer) and returns: False, False, True, False