class_docstr: 通过该 callback 来测试带有 metrics 的 Trainer 是否训练测试正确；
class_docstr_tok: ["\u901a\u8fc7\u8be5","callback","\u6765\u6d4b\u8bd5\u5e26\u6709","metrics","\u7684","Trainer","\u662f\u5426\u8bad\u7ec3\u6d4b\u8bd5\u6b63\u786e\uff1b"]
code: def on_train_end(self, trainer):
      if self.larger_better:
          assert self.metric >= self.metric_begin_value
          assert self.metric > self.metric_threshold
      else:
          assert self.metric <= self.metric_begin_value
          assert self.metric < self.metric_threshold
  
imports: from fastNLP.core.callbacks.callback import Callback
label_desc: Use image node_id 3 for calling the RecordMetricCallback obj's underlying member method code with example usage: obj.on_train_end(trainer) without return types