mindformers.core.EvalCallBack

View Source On Gitee
class mindformers.core.EvalCallBack(eval_func: Callable, step_interval: int = 100, epoch_interval: int = - 1)[source]

Evaluate Callback used in training progress.

Parameters
  • eval_func (Callable) – The function used to evaluate the model results and can be customized according to specific task.

  • step_interval (int) – Determine the num of step intervals between each eval. Default 100. Note that it will not take effects when running in data sink mode.

  • epoch_interval (int) – Determine the num of epoch intervals between each eval. Default -1, means eval on every epoch end.

Examples

>>> from mindformers.core.callback import EvalCallBack
>>> def eval_func():
...     print("output result")
>>> eval_callback = EvalCallBack(eval_func=eval_func)
>>> type(eval_callback)