MiniDNN
VerboseCallback.h
1 #ifndef CALLBACK_VERBOSECALLBACK_H_
2 #define CALLBACK_VERBOSECALLBACK_H_
3 
4 #include <Eigen/Core>
5 #include <iostream>
6 #include "../Config.h"
7 #include "../Callback.h"
8 #include "../Network.h"
9 
10 namespace MiniDNN {
11 
12 
19 {
20 public:
21  void post_training_batch(const Network* net, const Matrix& x, const Matrix& y)
22  {
23  const Scalar loss = net->get_output()->loss();
24  std::cout << "[Epoch " << m_epoch_id << ", batch " << m_batch_id << "] Loss = " << loss << std::endl;
25  }
26 
27  void post_training_batch(const Network* net, const Matrix& x, const IntegerVector& y)
28  {
29  Scalar loss = net->get_output()->loss();
30  std::cout << "[Epoch " << m_epoch_id << ", batch " << m_batch_id << "] Loss = " << loss << std::endl;
31  }
32 };
33 
34 
35 } // namespace MiniDNN
36 
37 
38 #endif /* CALLBACK_VERBOSECALLBACK_H_ */
const Output * get_output() const
Definition: Network.h:214