You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.train.callback.RunContext.rst 825 B

4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132
  1. .. py:class:: mindspore.train.callback.RunContext(original_args)
  2. 提供模型的相关信息。
  3. 在Model方法里提供模型的相关信息。
  4. 回调函数可以调用 `request_stop()` 方法来停止迭代。
  5. **参数:**
  6. - **original_args** (dict) - 模型的相关信息。
  7. .. py:method:: get_stop_requested()
  8. 获取是否停止训练的标志。
  9. **返回:**
  10. bool,如果为True,则 `Model.train()` 停止迭代。
  11. .. py:method:: original_args()
  12. 获取模型相关信息的对象。
  13. **返回:**
  14. dict,含有模型的相关信息的对象。
  15. .. py:method:: request_stop()
  16. 在训练期间设置停止请求。
  17. 可以使用此函数请求停止训练。 `Model.train()` 会检查是否调用此函数。