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.dataset.DSCallback.rst 1.7 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. mindspore.dataset.DSCallback
  2. =============================
  3. .. py:class:: mindspore.dataset.DSCallback(step_size=1)
  4. 数据处理回调类的抽象基类,用户可以基于此类实现自己的回调操作。
  5. 用户可通过 `ds_run_context` 获取数据处理管道相关信息,包括 `cur_epoch_num` (当前epoch数)、 `cur_step_num_in_epoch` (当前epoch的step数)、 `cur_step_num` (当前step数)。
  6. **参数:**
  7. - **step_size** (int, optional) - 定义相邻的 `ds_step_begin`/`ds_step_end` 调用之间相隔的step数,默认值:1,表示每个step都会调用。
  8. .. py:method:: ds_begin(ds_run_context)
  9. 用于定义在数据处理管道启动前执行的回调方法。
  10. **参数:**
  11. - **ds_run_context** (RunContext) - 数据处理管道运行信息。
  12. .. py:method:: ds_epoch_begin(ds_run_context)
  13. 用于定义在每个数据epoch开始前执行的回调方法。
  14. **参数:**
  15. - **ds_run_context** (RunContext) - 数据处理管道运行信息。
  16. .. py:method:: ds_epoch_end(ds_run_context)
  17. 用于定义在每个数据epoch结束后执行的回调方法。
  18. **参数:**
  19. - **ds_run_context** (RunContext) - 数据处理管道运行信息。
  20. .. py:method:: ds_step_begin(ds_run_context)
  21. 用于定义在指定数据step开始前执行的回调方法。
  22. **参数:**
  23. - **ds_run_context** (RunContext) - 数据处理管道运行信息。
  24. .. py:method:: ds_step_end(ds_run_context)
  25. 用于定义在指定数据step结束后执行的回调方法。
  26. **参数:**
  27. - **ds_run_context** (RunContext) - 数据处理管道运行信息。