MachineIntelligenceCore:NeuralNets
|
Class implementing a simple MNIST patch reconstruction with multi-layer neural net. More...
#include <MNISTPatchReconstructionApplication.hpp>
Public Member Functions | |
MNISTPatchReconstructionApplication (std::string node_name_="mnist_patch_autoencoder_reconstruction") | |
virtual | ~MNISTPatchReconstructionApplication () |
Protected Member Functions | |
virtual void | initializePropertyDependentVariables () |
virtual void | initialize (int argc, char *argv[]) |
virtual bool | performLearningStep () |
virtual void | collectTestStatistics () |
virtual void | populateTestStatistics () |
Private Attributes | |
mic::types::MatrixXfPtr | input_image |
Input image/matrix. More... | |
mic::types::MatrixXfPtr | reconstructed_image |
Reconstructed image/matrix. More... | |
mic::importers::MNISTPatchImporter * | training_dataset_importer |
Importer responsible for loading training dataset. More... | |
mic::importers::MNISTPatchImporter * | test_dataset_importer |
Importer responsible for loading testing dataset. More... | |
WindowMatrix2D * | w2d_input |
Window for displaying the input image. More... | |
WindowMatrix2D * | w2d_reconstruction |
Window for displaying the reconstructed image. More... | |
WindowCollectorChart< float > * | w_chart |
Window for displaying chart with statistics. More... | |
size_t | patch_size |
Size of the patch - copied from importers. More... | |
mic::utils::DataCollectorPtr < std::string, float > | collector_ptr |
Data collector. More... | |
mic::configuration::Property < std::string > | mlnn_filename |
Property: name of the file to which the neural network will be serialized (or deserialized from). More... | |
mic::configuration::Property < bool > | mlnn_save |
Property: flag denoting whether the nn should be saved to a file (after every episode end). More... | |
mic::configuration::Property < bool > | mlnn_load |
Property: flag denoting whether the nn should be loaded from a file (at the initialization of the task). More... | |
BackpropagationNeuralNetwork < float > | neural_net |
Multi-layer neural network. More... | |
Class implementing a simple MNIST patch reconstruction with multi-layer neural net.
Definition at line 47 of file MNISTPatchReconstructionApplication.hpp.
mic::applications::MNISTPatchReconstructionApplication::MNISTPatchReconstructionApplication | ( | std::string | node_name_ = "mnist_patch_autoencoder_reconstruction" | ) |
Default Constructor. Sets the application/node name, default values of variables, initializes classifier etc.
node_name_ | Name of the application/node (in configuration file). |
Definition at line 58 of file MNISTPatchReconstructionApplication.cpp.
References mlnn_filename, mlnn_load, mlnn_save, test_dataset_importer, and training_dataset_importer.
|
virtual |
Destructor.
Definition at line 76 of file MNISTPatchReconstructionApplication.cpp.
References test_dataset_importer, training_dataset_importer, w2d_input, w2d_reconstruction, and w_chart.
|
protectedvirtual |
Collects test statistics, executed in every testing step.
Definition at line 178 of file MNISTPatchReconstructionApplication.cpp.
References collector_ptr, mic::mlnn::MultiLayerNeuralNetwork< eT >::getPredictions(), neural_net, patch_size, reconstructed_image, mic::mlnn::BackpropagationNeuralNetwork< eT >::test(), and test_dataset_importer.
|
protectedvirtual |
Method initializes GLUT and OpenGL windows.
argc | Number of application parameters. |
argv | Array of application parameters. |
Definition at line 85 of file MNISTPatchReconstructionApplication.cpp.
References collector_ptr, w2d_input, w2d_reconstruction, and w_chart.
|
protectedvirtual |
Initializes all variables that are property-dependent, imports MNIST datasets, for both learning and testing purposes.
Definition at line 105 of file MNISTPatchReconstructionApplication.cpp.
References input_image, mic::mlnn::MultiLayerNeuralNetwork< eT >::load(), mlnn_filename, mlnn_load, neural_net, patch_size, mic::mlnn::MultiLayerNeuralNetwork< eT >::pushLayer(), reconstructed_image, mic::mlnn::BackpropagationNeuralNetwork< eT >::setLoss(), test_dataset_importer, training_dataset_importer, w2d_input, and w2d_reconstruction.
|
protectedvirtual |
Performs learning step.
Definition at line 150 of file MNISTPatchReconstructionApplication.cpp.
References collector_ptr, mic::mlnn::MultiLayerNeuralNetwork< eT >::getPredictions(), neural_net, patch_size, reconstructed_image, mic::mlnn::BackpropagationNeuralNetwork< eT >::train(), and training_dataset_importer.
|
protectedvirtual |
Populates test statistics, executed only every number_of_averaged_test_measures testing steps.
Definition at line 205 of file MNISTPatchReconstructionApplication.cpp.
References mlnn_filename, mlnn_save, neural_net, and mic::mlnn::MultiLayerNeuralNetwork< eT >::save().
|
private |
Data collector.
Definition at line 115 of file MNISTPatchReconstructionApplication.hpp.
Referenced by collectTestStatistics(), initialize(), and performLearningStep().
|
private |
Input image/matrix.
Definition at line 91 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initializePropertyDependentVariables().
|
private |
Property: name of the file to which the neural network will be serialized (or deserialized from).
Definition at line 118 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initializePropertyDependentVariables(), MNISTPatchReconstructionApplication(), and populateTestStatistics().
|
private |
Property: flag denoting whether the nn should be loaded from a file (at the initialization of the task).
Definition at line 124 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initializePropertyDependentVariables(), and MNISTPatchReconstructionApplication().
|
private |
Property: flag denoting whether the nn should be saved to a file (after every episode end).
Definition at line 121 of file MNISTPatchReconstructionApplication.hpp.
Referenced by MNISTPatchReconstructionApplication(), and populateTestStatistics().
|
private |
Multi-layer neural network.
Definition at line 127 of file MNISTPatchReconstructionApplication.hpp.
Referenced by collectTestStatistics(), initializePropertyDependentVariables(), performLearningStep(), and populateTestStatistics().
|
private |
Size of the patch - copied from importers.
Definition at line 112 of file MNISTPatchReconstructionApplication.hpp.
Referenced by collectTestStatistics(), initializePropertyDependentVariables(), and performLearningStep().
|
private |
Reconstructed image/matrix.
Definition at line 94 of file MNISTPatchReconstructionApplication.hpp.
Referenced by collectTestStatistics(), initializePropertyDependentVariables(), and performLearningStep().
|
private |
Importer responsible for loading testing dataset.
Definition at line 100 of file MNISTPatchReconstructionApplication.hpp.
Referenced by collectTestStatistics(), initializePropertyDependentVariables(), MNISTPatchReconstructionApplication(), and ~MNISTPatchReconstructionApplication().
|
private |
Importer responsible for loading training dataset.
Definition at line 97 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initializePropertyDependentVariables(), MNISTPatchReconstructionApplication(), performLearningStep(), and ~MNISTPatchReconstructionApplication().
|
private |
Window for displaying the input image.
Definition at line 103 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initialize(), initializePropertyDependentVariables(), and ~MNISTPatchReconstructionApplication().
|
private |
Window for displaying the reconstructed image.
Definition at line 106 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initialize(), initializePropertyDependentVariables(), and ~MNISTPatchReconstructionApplication().
|
private |
Window for displaying chart with statistics.
Definition at line 109 of file MNISTPatchReconstructionApplication.hpp.
Referenced by initialize(), and ~MNISTPatchReconstructionApplication().