Class TrainCallBack

Inheritance Relationships

Derived Types

Class Documentation

class TrainCallBack

Subclassed by mindspore::CkptSaver, mindspore::LRScheduler, mindspore::LossMonitor, mindspore::TimeMonitor, mindspore::TrainAccuracy

Public Functions

inline virtual void Begin(const TrainCallBackData &cb_data)

This method is called once before the network executing.

Parameters

cb_data[in] info about current execution

inline virtual void End(const TrainCallBackData &cb_data)

This method is called once following the network execution.

Parameters

cb_data[in] info about current execution

inline virtual void EpochBegin(const TrainCallBackData &cb_data)

This method is called at the beginning of each epoch.

Parameters

cb_data[in] info about current execution

inline virtual CallbackRetValue EpochEnd(const TrainCallBackData &cb_data)

This method is called after the run of each epoch.

Parameters

cb_data[in] info about current execution

Returns

indication if to continue in the train loop: RET_CONTINUE — continue training RET_STOP_TRAINING — stop training (e.g., due to achieved accuracy) RET_EXIT — Exit training (due to error of some sort)

inline virtual void StepBegin(const TrainCallBackData &cb_data)

This method is called at the beginning of each step.

Parameters

cb_data[in] info about current execution

inline virtual void StepEnd(const TrainCallBackData &cb_data)

This method is called after each step is ran.

Parameters

cb_data[in] info about current execution