29 #ifndef LBANN_CALLBACKS_CALLBACK_TIMELINE_HPP_INCLUDED 30 #define LBANN_CALLBACKS_CALLBACK_TIMELINE_HPP_INCLUDED 35 #include <unordered_map> 55 std::string
name()
const override {
return "timeline"; }
77 template <
class Archive>
103 std::unordered_map<std::string, std::vector<std::pair<EvalType, EvalType>>>
105 std::unordered_map<std::string, std::vector<std::pair<EvalType, EvalType>>>
107 std::unordered_map<std::string, std::vector<std::pair<EvalType, EvalType>>>
112 std::unique_ptr<callback_base>
114 std::shared_ptr<lbann_summary>
const&);
119 #endif // LBANN_CALLBACKS_CALLBACK_TIMELINE_HPP_INCLUDED void on_backward_prop_begin(model *m, Layer *l) override
Called when a layer begins backward propagation.
virtual void on_optimize_begin(model *m)
Called when a model begins optimization.
timeline * copy() const override
void on_optimize_end(model *m, weights *w) override
Called when weights ends optimization.
EvalType m_fp_start_time
Time the current layer's forward pass started.
EvalType m_start_time
Time training started; all times are relative to this.
std::unordered_map< std::string, std::vector< std::pair< EvalType, EvalType > > > m_fp_times
Store (relative) timing information.
void on_backward_prop_end(model *m, Layer *l) override
Called when a layer ends backward propagation.
void on_forward_prop_begin(model *m, Layer *l) override
Called when a layer begins forward propagation.
void on_optimize_begin(model *m, weights *w) override
Called when weights begins optimization.
Neural network tensor operation.
virtual void on_backward_prop_begin(model *m)
Called when a model begins backward propagation.
void on_train_end(model *m) override
Called at the end of training.
std::string m_outdir
Directory to write output to.
Base class for callbacks during training/testing.
std::unordered_map< std::string, std::vector< std::pair< EvalType, EvalType > > > m_opt_times
Abstract base class for neural network models.
virtual void on_forward_prop_end(model *m)
Called when a model ends forward propagation.
void on_forward_prop_end(model *m, Layer *l) override
Called when a layer ends forward propagation.
virtual void on_optimize_end(model *m)
Called when a model ends optimization.
void on_train_begin(model *m) override
Called at the beginning of training.
std::string name() const override
Return this callback's name.
void serialize(Archive &ar)
Store state to archive for checkpoint and restart.
EvalType m_opt_start_time
Time the current weights' optimization pass started.
timeline(std::string outdir)
EvalType m_bp_start_time
Time the current layer's backward pass started.
virtual void on_backward_prop_end(model *m)
Called when a model ends backward propagation.
friend class cereal::access
virtual void on_forward_prop_begin(model *m)
Called when a model begins forward propagation.
double get_time()
Return time in fractional seconds since an epoch.
std::unique_ptr< callback_base > build_timeline_callback_from_pbuf(const google::protobuf::Message &, std::shared_ptr< lbann_summary > const &)
std::unordered_map< std::string, std::vector< std::pair< EvalType, EvalType > > > m_bp_times
void write_specific_proto(lbann_data::Callback &proto) const final
timeline & operator=(const timeline &)=default
EvalType get_rel_time() const
Get time relative to the start time.