MachineIntelligenceCore:NeuralNets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
MNISTPatchReconstructionApplication.hpp
Go to the documentation of this file.
1 
25 #ifndef MNISTPATCHRECONSTRUCTIONAPPLICATION_H_
26 #define MNISTPATCHRECONSTRUCTIONAPPLICATION_H_
27 
28 
29 #include <opengl/application/OpenGLContinuousLearningApplication.hpp>
30 
31 #include <opengl/visualization/WindowMatrix2D.hpp>
32 #include <opengl/visualization/WindowCollectorChart.hpp>
33 using namespace mic::opengl::visualization;
34 
35 #include <importers/MNISTPatchImporter.hpp>
36 
38 using namespace mic::mlnn;
39 
40 namespace mic {
41 namespace applications {
42 
47 class MNISTPatchReconstructionApplication: public mic::opengl::application::OpenGLContinuousLearningApplication {
48 public:
53  MNISTPatchReconstructionApplication(std::string node_name_ = "mnist_patch_autoencoder_reconstruction");
54 
59 
60 protected:
64  virtual void initializePropertyDependentVariables();
65 
71  virtual void initialize(int argc, char* argv[]);
72 
76  virtual bool performLearningStep();
77 
81  virtual void collectTestStatistics();
82 
86  virtual void populateTestStatistics();
87 
88 
89 private:
91  mic::types::MatrixXfPtr input_image;
92 
94  mic::types::MatrixXfPtr reconstructed_image;
95 
97  mic::importers::MNISTPatchImporter* training_dataset_importer;
98 
100  mic::importers::MNISTPatchImporter* test_dataset_importer;
101 
103  WindowMatrix2D* w2d_input;
104 
106  WindowMatrix2D* w2d_reconstruction;
107 
109  WindowCollectorChart<float>* w_chart;
110 
112  size_t patch_size;
113 
115  mic::utils::DataCollectorPtr<std::string, float> collector_ptr;
116 
118  mic::configuration::Property<std::string> mlnn_filename;
119 
121  mic::configuration::Property<bool> mlnn_save;
122 
124  mic::configuration::Property<bool> mlnn_load;
125 
128 
129 };
130 
131 } /* namespace applications */
132 } /* namespace mic */
133 
134 #endif /* MNISTPATCHRECONSTRUCTIONAPPLICATION_H_ */
mic::types::MatrixXfPtr reconstructed_image
Reconstructed image/matrix.
mic::importers::MNISTPatchImporter * training_dataset_importer
Importer responsible for loading training dataset.
mic::importers::MNISTPatchImporter * test_dataset_importer
Importer responsible for loading testing dataset.
WindowCollectorChart< float > * w_chart
Window for displaying chart with statistics.
Class implementing a simple MNIST patch reconstruction with multi-layer neural net.
WindowMatrix2D * w2d_input
Window for displaying the input image.
mic::configuration::Property< bool > mlnn_load
Property: flag denoting whether the nn should be loaded from a file (at the initialization of the tas...
mic::configuration::Property< std::string > mlnn_filename
Property: name of the file to which the neural network will be serialized (or deserialized from)...
mic::configuration::Property< bool > mlnn_save
Property: flag denoting whether the nn should be saved to a file (after every episode end)...
BackpropagationNeuralNetwork< float > neural_net
Multi-layer neural network.
WindowMatrix2D * w2d_reconstruction
Window for displaying the reconstructed image.
mic::utils::DataCollectorPtr< std::string, float > collector_ptr
Data collector.