44 namespace application {
56 namespace applications {
59 mlnn_filename(
"mlnn_filename",
"mlnn.txt"),
60 mlnn_save(
"mlnn_save", false),
61 mlnn_load(
"mlnn_load", false)
68 LOG(LINFO) <<
"Properties registered";
88 VGL_MANAGER->initializeGLUT(argc, argv);
91 w2d_input =
new WindowMatrix2D(
"Input matrix", 0, 0, 256, 256);
94 collector_ptr = std::make_shared < mic::utils::DataCollector<std::string, float> >( );
96 collector_ptr->createContainer(
"training_loss", mic::types::color_rgba(0, 0, 255, 180));
97 collector_ptr->createContainer(
"test_loss", mic::types::color_rgba(0, 255, 0, 180));
100 w_chart =
new WindowCollectorChart<float>(
"MNISTPatchReconstruction", 0, 310, 512, 256);
106 LOG(LTRACE) <<
"MNISTClassificationSoftmaxApplication::initializePropertyDependentVariables";
144 LOG(LINFO) <<
"Generated new neural network";
156 (*input_image) = (*sample.data());
160 mic::types::MatrixXfPtr encoded_patch (
new mic::types::MatrixXf(*sample.data()));
172 (*reconstructed_image) = (*encoded_reconstruction);
183 (*input_image) = (*sample.data());
186 mic::types::MatrixXfPtr encoded_patch (
new mic::types::MatrixXf(*sample.data()));
196 (*reconstructed_image) = (*decoded_reconstruction);
222 LOG(LINFO)<<
"Iteration = " << iteration;
mic::types::MatrixXfPtr reconstructed_image
Reconstructed image/matrix.
bool save(std::string filename_)
mic::importers::MNISTPatchImporter * training_dataset_importer
Importer responsible for loading training dataset.
mic::importers::MNISTPatchImporter * test_dataset_importer
Importer responsible for loading testing dataset.
mic::types::MatrixXfPtr input_image
Input image/matrix.
virtual void collectTestStatistics()
virtual bool performLearningStep()
WindowCollectorChart< float > * w_chart
Window for displaying chart with statistics.
Class implementing a simple MNIST patch reconstruction with multi-layer neural net.
virtual ~MNISTPatchReconstructionApplication()
virtual void populateTestStatistics()
MNISTPatchReconstructionApplication(std::string node_name_="mnist_patch_autoencoder_reconstruction")
virtual void initialize(int argc, char *argv[])
WindowMatrix2D * w2d_input
Window for displaying the input image.
mic::types::MatrixPtr< eT > getPredictions()
void RegisterApplication(void)
Registers application.
eT test(mic::types::MatrixPtr< eT > encoded_batch_, mic::types::MatrixPtr< eT > encoded_targets_)
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)...
virtual void initializePropertyDependentVariables()
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.
eT train(mic::types::MatrixPtr< eT > encoded_batch_, mic::types::MatrixPtr< eT > encoded_targets_, eT learning_rate_, eT decay_=0.0f)
WindowMatrix2D * w2d_reconstruction
Window for displaying the reconstructed image.
size_t patch_size
Size of the patch - copied from importers.
mic::utils::DataCollectorPtr< std::string, float > collector_ptr
Data collector.
void pushLayer(LayerType *layer_ptr_)
bool load(std::string filename_)