Program Listing for File loss_monitor.h

Return to documentation for file (include/loss_monitor.h)

#ifndef MINDSPORE_INCLUDE_API_CALLBACK_LOSS_MONITOR_H
#define MINDSPORE_INCLUDE_API_CALLBACK_LOSS_MONITOR_H

#include <cstddef>
#include <vector>
#include <utility>
#include "include/api/callback/callback.h"

using GraphPoint = std::pair<int, float>;

namespace mindspore {

class LossMonitor: public TrainCallBack {
 public:
  explicit LossMonitor(int print_every_n_steps = INT_MAX);
  virtual ~LossMonitor();
  const std::vector<GraphPoint> &GetLossPoints();
};
}  // namespace mindspore
#endif  // MINDSPORE_INCLUDE_API_CALLBACK_LOSS_MONITOR_H