MachineIntelligenceCore:NeuralNets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
MNISTPatchSoftmaxApplication.hpp
Go to the documentation of this file.
1 
25 #ifndef MNISTPATCHSOFTMAXAPPLICATION_H_
26 #define MNISTPATCHSOFTMAXAPPLICATION_H_
27 
28 
29 #include <opengl/application/OpenGLContinuousLearningApplication.hpp>
30 
31 #include <opengl/visualization/WindowMatrix2D.hpp>
32 #include <opengl/visualization/WindowProbability.hpp>
33 #include <opengl/visualization/WindowCollectorChart.hpp>
34 using namespace mic::opengl::visualization;
35 
36 #include <importers/MNISTPatchImporter.hpp>
37 
39 using namespace mic::mlnn;
40 
41 #include <encoders/MatrixXfMatrixXfEncoder.hpp>
42 #include <encoders/UIntMatrixXfEncoder.hpp>
43 
44 
45 namespace mic {
46 namespace applications {
47 
52 class MNISTPatchSoftmaxApplication: public mic::opengl::application::OpenGLContinuousLearningApplication {
53 public:
58  MNISTPatchSoftmaxApplication(std::string node_name_ = "mnist_patch_autoencoder_reconstruction");
59 
64 
65 protected:
69  virtual void initializePropertyDependentVariables();
70 
76  virtual void initialize(int argc, char* argv[]);
77 
81  virtual bool performLearningStep();
82 
86  virtual void collectTestStatistics();
87 
91  virtual void populateTestStatistics();
92 
93 
94 private:
96  mic::importers::MNISTPatchImporter* training_dataset_importer;
97 
99  mic::importers::MNISTPatchImporter* test_dataset_importer;
100 
102  mic::encoders::MatrixXfMatrixXfEncoder* mnist_encoder;
103 
105  mic::encoders::UIntMatrixXfEncoder* label_encoder;
106 
108  WindowMatrix2D* w2d_input;
109 
111  WindowCollectorChart<float>* w_chart;
112 
114  WindowProbability* w_prob;
115 
117  mic::types::MatrixXfPtr input_image;
118 
120  mic::types::MatrixXfPtr decoded_prediction;
121 
123  mic::types::MatrixXfPtr input_target;
124 
126  size_t patch_size;
127 
129  mic::utils::DataCollectorPtr<std::string, float> collector_ptr;
130 
132  mic::configuration::Property<std::string> autoencoder_filename;
133 
135  mic::configuration::Property<size_t> autoencoder_layers_to_be_removed;
136 
138  mic::configuration::Property<std::string> softmax_filename;
139 
141  mic::configuration::Property<bool> softmax_save;
142 
144  mic::configuration::Property<bool> softmax_load;
145 
148 
149 };
150 
151 } /* namespace applications */
152 } /* namespace mic */
153 
154 #endif /* MNISTPATCHSOFTMAXAPPLICATION_H_ */
mic::utils::DataCollectorPtr< std::string, float > collector_ptr
Data collector.
mic::configuration::Property< std::string > autoencoder_filename
Property: name of the file to which the original auto-encoder will be loaded from.
Class implementing a simple MNIST patch softmax classification with multi-layer neural net - imported...
BackpropagationNeuralNetwork< float > neural_net
Multi-layer neural network.
mic::types::MatrixXfPtr input_image
Input image/matrix.
WindowProbability * w_prob
Window displaying the probabilities.
mic::configuration::Property< bool > softmax_load
Property: flag denoting whether the nn should be loaded from a file (at the initialization of the tas...
mic::configuration::Property< bool > softmax_save
Property: flag denoting whether the nn should be saved to a file (after every episode end)...
mic::configuration::Property< std::string > softmax_filename
Property: name of the file with softmax nn.
WindowCollectorChart< float > * w_chart
Window for displaying chart with statistics.
WindowMatrix2D * w2d_input
Window for displaying the input image.
mic::importers::MNISTPatchImporter * training_dataset_importer
Importer responsible for loading training dataset.
size_t patch_size
Size of the patch - copied from importers.
mic::configuration::Property< size_t > autoencoder_layers_to_be_removed
Property: number of layers to be removed (starting from the last one).
mic::encoders::UIntMatrixXfEncoder * label_encoder
Label 2 matrix encoder (1 hot).
mic::encoders::MatrixXfMatrixXfEncoder * mnist_encoder
MNIST matrix encoder.
mic::importers::MNISTPatchImporter * test_dataset_importer
Importer responsible for loading testing dataset.