diff --git a/DataAnalysis/applications/NumRecApp.cpp b/DataAnalysis/applications/NumRecApp.cpp index aa98ac9..ecde746 100644 --- a/DataAnalysis/applications/NumRecApp.cpp +++ b/DataAnalysis/applications/NumRecApp.cpp @@ -10,6 +10,8 @@ using namespace tp; +#include + void loadImage(Buffer& output, const char* name) { int x, y, channels_in_file; unsigned char* loadedImage = stbi_load(name, &x, &y, &channels_in_file, 4); @@ -28,7 +30,9 @@ void loadImage(Buffer& output, const char* name) { void loadNN(FCNN& nn) { ArchiverLocalConnection archiver; - archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true)); + if (std::filesystem::exists(std::filesystem::path("NumRec.wb"))) { + archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true)); + } if (archiver.connection.getConnectionStatus().isOpened()) { archiver % nn; @@ -56,7 +60,7 @@ void executeCmd(const char* imageName) { } int main(int argc, char** argv) { - const char* imageName = "digit.png"; + const char* imageName = "tmp2.png"; if (argc == 2) { imageName = argv[1]; diff --git a/DataAnalysis/applications/NumRecTraining.cpp b/DataAnalysis/applications/NumRecTraining.cpp index e6c808e..dcba426 100644 --- a/DataAnalysis/applications/NumRecTraining.cpp +++ b/DataAnalysis/applications/NumRecTraining.cpp @@ -1,3 +1,4 @@ +#include #include "FCNN.hpp" #include "LocalConnection.hpp" @@ -71,7 +72,9 @@ struct NumberRec { { ArchiverLocalConnection archiver; - archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true)); + if (std::filesystem::exists(std::filesystem::path("NumRec.wb"))) { + archiver.connection.connect(LocalConnection::Location("NumRec.wb"), LocalConnection::Type(true)); + } if (archiver.connection.getConnectionStatus().isOpened()) { archiver % nn; @@ -215,7 +218,7 @@ int main() { auto batchSize = trainRange.idxDiff() / numBatches; - for (auto epoch : IterRange(1)) { + for (auto epoch : IterRange(10)) { printf("Epoch %i\n", epoch.index()); for (auto batchIdx : IterRange(trainRange.idxDiff() / batchSize)) { @@ -241,5 +244,5 @@ int main() { // app.displayImage(i); } - printf("\n\nIncorrect - %i out of %i (%f)\n\n", errors, testRange.idxDiff(), (halnf) errors / (halnf) testRange.idxDiff()); + printf("\n\nIncorrect - %i out of %i error percentage (%f)\n\n", errors, testRange.idxDiff(), (halnf) errors / (halnf) testRange.idxDiff()); } \ No newline at end of file diff --git a/Externals/lalr b/Externals/lalr index 6d16a6b..4986122 160000 --- a/Externals/lalr +++ b/Externals/lalr @@ -1 +1 @@ -Subproject commit 6d16a6bb60490a2ee4e86f689c86e647b300c7fb +Subproject commit 498612239713a6dbbf9f26b8e412e985538a0650 diff --git a/LibraryViewer/CMakeLists.txt b/LibraryViewer/CMakeLists.txt index becb208..4400a13 100644 --- a/LibraryViewer/CMakeLists.txt +++ b/LibraryViewer/CMakeLists.txt @@ -15,7 +15,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC Graphics Connection Widgets) target_link_libraries(${PROJECT_NAME} PUBLIC ${BINDINGS_LIBS}) file(COPY "library" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}") -file(COPY "applications/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/") +file(COPY "applications/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/rsc/") ### -------------------------- Applications -------------------------- ### add_executable(libView ./applications/Entry.cpp) diff --git a/Sketch3D/CMakeLists.txt b/Sketch3D/CMakeLists.txt index 248c80d..b5eb9f8 100644 --- a/Sketch3D/CMakeLists.txt +++ b/Sketch3D/CMakeLists.txt @@ -19,4 +19,4 @@ add_executable(Sketch3DApp ./applications/Entry.cpp) target_link_libraries(Sketch3DApp ${PROJECT_NAME}) file(COPY "rsc" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/") -file(COPY "applications/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/") +file(COPY "applications/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/rsc") diff --git a/Widgets/CMakeLists.txt b/Widgets/CMakeLists.txt index 0589f17..c4a68a5 100644 --- a/Widgets/CMakeLists.txt +++ b/Widgets/CMakeLists.txt @@ -14,4 +14,4 @@ add_executable(WidgetsExample examples/Example.cpp) target_link_libraries(WidgetsExample ${PROJECT_NAME} ${GLEW_LIB}) target_include_directories(WidgetsExample PUBLIC ../Externals/glfw/include ${GLEW_INCLUDE_DIR}) -file(COPY "examples/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/") \ No newline at end of file +file(COPY "examples/Font.ttf" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/rsc")