BaseMonitor¶
- class BaseMonitor(config)[源代码]¶
- BaseMonitor是一个基础的监控器类,用于记录模型训练过程中的统计信息
其中,trainer 会将需要统计的数据存放到 item 中,目前 item 的内容为:
item = { "batch": (input_ids, labels), "epoch_idx": 0, "batch_idx": 1, "global_batch_idx": 1, "loss": 0.1, "eval_result": { "acc": 0.1, "ppl": 0.1, ... }, "memory_allocated": 7000000000, "mode": "train" }
- 参数:
config – 用户传入的config,类型为CollieConfig