mindspore2022/docs/api/api_python/mindspore.train/mindspore.train.callback.Ru...

34 lines
793 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Class mindspore.train.callback.RunContext(original_args)
提供模型的相关信息。
在Model方法里提供模型的相关信息。
回调函数可以通过调用request_stop()方法来停止循环。
参数:
original_args (dict):模型的相关信息。
get_stop_requested()
获取是否停止训练标志。
返回:
bool如果为True则Model.train()停止迭代。
original_args()
获取模型的相关信息。
返回:
dict模型的相关信息。
request_stop()
在训练期间设置停止请求。
可以使用此函数请求停止训练。
Model.train()会检查是否调用此函数。