MachineIntelligenceCore:NeuralNets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
mic::applications::MNISTPatchReconstructionApplication Class Reference

Class implementing a simple MNIST patch reconstruction with multi-layer neural net. More...

#include <MNISTPatchReconstructionApplication.hpp>

Inheritance diagram for mic::applications::MNISTPatchReconstructionApplication:
Collaboration diagram for mic::applications::MNISTPatchReconstructionApplication:

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...
 

Detailed Description

Class implementing a simple MNIST patch reconstruction with multi-layer neural net.

Author
tkornuta

Definition at line 47 of file MNISTPatchReconstructionApplication.hpp.

Constructor & Destructor Documentation

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.

Parameters
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.

mic::applications::MNISTPatchReconstructionApplication::~MNISTPatchReconstructionApplication ( )
virtual

Member Function Documentation

void mic::applications::MNISTPatchReconstructionApplication::collectTestStatistics ( )
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.

Here is the call graph for this function:

void mic::applications::MNISTPatchReconstructionApplication::initialize ( int  argc,
char *  argv[] 
)
protectedvirtual

Method initializes GLUT and OpenGL windows.

Parameters
argcNumber of application parameters.
argvArray of application parameters.

Definition at line 85 of file MNISTPatchReconstructionApplication.cpp.

References collector_ptr, w2d_input, w2d_reconstruction, and w_chart.

void mic::applications::MNISTPatchReconstructionApplication::initializePropertyDependentVariables ( )
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.

Here is the call graph for this function:

bool mic::applications::MNISTPatchReconstructionApplication::performLearningStep ( )
protectedvirtual
void mic::applications::MNISTPatchReconstructionApplication::populateTestStatistics ( )
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().

Here is the call graph for this function:

Member Data Documentation

mic::utils::DataCollectorPtr<std::string, float> mic::applications::MNISTPatchReconstructionApplication::collector_ptr
private

Data collector.

Definition at line 115 of file MNISTPatchReconstructionApplication.hpp.

Referenced by collectTestStatistics(), initialize(), and performLearningStep().

mic::types::MatrixXfPtr mic::applications::MNISTPatchReconstructionApplication::input_image
private

Input image/matrix.

Definition at line 91 of file MNISTPatchReconstructionApplication.hpp.

Referenced by initializePropertyDependentVariables().

mic::configuration::Property<std::string> mic::applications::MNISTPatchReconstructionApplication::mlnn_filename
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().

mic::configuration::Property<bool> mic::applications::MNISTPatchReconstructionApplication::mlnn_load
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().

mic::configuration::Property<bool> mic::applications::MNISTPatchReconstructionApplication::mlnn_save
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().

BackpropagationNeuralNetwork<float> mic::applications::MNISTPatchReconstructionApplication::neural_net
private
size_t mic::applications::MNISTPatchReconstructionApplication::patch_size
private

Size of the patch - copied from importers.

Definition at line 112 of file MNISTPatchReconstructionApplication.hpp.

Referenced by collectTestStatistics(), initializePropertyDependentVariables(), and performLearningStep().

mic::types::MatrixXfPtr mic::applications::MNISTPatchReconstructionApplication::reconstructed_image
private

Reconstructed image/matrix.

Definition at line 94 of file MNISTPatchReconstructionApplication.hpp.

Referenced by collectTestStatistics(), initializePropertyDependentVariables(), and performLearningStep().

mic::importers::MNISTPatchImporter* mic::applications::MNISTPatchReconstructionApplication::test_dataset_importer
private
mic::importers::MNISTPatchImporter* mic::applications::MNISTPatchReconstructionApplication::training_dataset_importer
private
WindowMatrix2D* mic::applications::MNISTPatchReconstructionApplication::w2d_input
private

Window for displaying the input image.

Definition at line 103 of file MNISTPatchReconstructionApplication.hpp.

Referenced by initialize(), initializePropertyDependentVariables(), and ~MNISTPatchReconstructionApplication().

WindowMatrix2D* mic::applications::MNISTPatchReconstructionApplication::w2d_reconstruction
private

Window for displaying the reconstructed image.

Definition at line 106 of file MNISTPatchReconstructionApplication.hpp.

Referenced by initialize(), initializePropertyDependentVariables(), and ~MNISTPatchReconstructionApplication().

WindowCollectorChart<float>* mic::applications::MNISTPatchReconstructionApplication::w_chart
private

Window for displaying chart with statistics.

Definition at line 109 of file MNISTPatchReconstructionApplication.hpp.

Referenced by initialize(), and ~MNISTPatchReconstructionApplication().


The documentation for this class was generated from the following files: