26 #include <boost/thread/thread.hpp>
27 #include <boost/bind.hpp>
29 #include <importers/MNISTMatrixImporter.hpp>
31 #include <logger/Log.hpp>
32 #include <logger/ConsoleOutput.hpp>
33 using namespace mic::logger;
35 #include <application/ApplicationState.hpp>
37 #include <configuration/ParameterServer.hpp>
39 #include <opengl/visualization/WindowManager.hpp>
40 #include <opengl/visualization/WindowGrayscaleBatch.hpp>
41 using namespace mic::opengl::visualization;
46 mic::importers::MNISTMatrixImporter<float>*
importer;
55 while (!APP_STATE->Quit()) {
58 if (!APP_STATE->isPaused()) {
61 if (APP_STATE->isSingleStepModeOn())
62 APP_STATE->pressPause();
65 APP_DATA_SYNCHRONIZATION_SCOPED_LOCK();
68 mic::types::MNISTBatch<float> bt =
importer->getNextBatch();
71 w_batch->setBatchUnsynchronized(bt.data());
92 int main(
int argc,
char* argv[]) {
94 LOGGER->addOutput(
new ConsoleOutput());
95 LOG(LINFO) <<
"Logger initialized. Starting application";
98 PARAM_SERVER->parseApplicationParameters(argc, argv);
104 importer =
new mic::importers::MNISTMatrixImporter<float>();
108 PARAM_SERVER->loadPropertiesFromConfiguration();
111 PARAM_SERVER->initializePropertyDependentVariables();
118 VGL_MANAGER->initializeGLUT(argc, argv);
121 w_batch =
new WindowGrayscaleBatch<float>(
"MNIST batch", Grayscale::Norm_HotCold, Grayscale::Grid_Both, 0, 0, 256, 256);
126 VGL_MANAGER->startVisualizationLoop();
128 LOG(LINFO) <<
"Waiting for threads to join...";
131 LOG(LINFO) <<
"Threads joined - ending application";
void batch_function(void)
Function for batch sampling.
int main(int argc, char *argv[])
Main program function. Runs two threads: main (for GLUT) and another one (for data processing)...
mic::importers::MNISTMatrixImporter< float > * importer
MNIST importer.
WindowGrayscaleBatch< float > * w_batch
Window for displaying the MNIST batch.