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 923 B

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