From d1c214070ee81a5e9b1c143b2ded3e97e3b42404 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 19 Dec 2024 14:43:22 -0500 Subject: [PATCH] python --- .idea/editor.xml | 483 ++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- commit.py | 0 python/neural_bag_of_words.py | 0 src/MNIST.cpp | 19 +- 5 files changed, 496 insertions(+), 8 deletions(-) create mode 100644 .idea/editor.xml mode change 100755 => 100644 commit.py create mode 100644 python/neural_bag_of_words.py diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..b0d69ef --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,483 @@ + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7587985..a17eb7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.29) +cmake_minimum_required(VERSION 3.25) project(COSC-4P80-Final-Project VERSION 0.0.2) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) diff --git a/commit.py b/commit.py old mode 100755 new mode 100644 diff --git a/python/neural_bag_of_words.py b/python/neural_bag_of_words.py new file mode 100644 index 0000000..e69de29 diff --git a/src/MNIST.cpp b/src/MNIST.cpp index 482e418..f64078a 100644 --- a/src/MNIST.cpp +++ b/src/MNIST.cpp @@ -227,13 +227,19 @@ namespace fp image_t train_image{train_images, train_labels}; image_t test_image{test_images, test_labels}; + // using net_type = loss_multiclass_log< + // fc<10, + // relu>>>>>>>>>>>>>; + using net_type = loss_multiclass_log< fc<10, - relu>>>>>>>>>>>>>; + sig>>>>>>>; net_type network{}; @@ -243,10 +249,9 @@ namespace fp trainer.set_mini_batch_size(128); trainer.be_verbose(); - trainer.set_synchronization_file("mnist_sync", std::chrono::seconds(20)); + // trainer.set_synchronization_file("mnist_sync", std::chrono::seconds(20)); trainer.train(train_image.get_image_data(), train_image.get_image_labels()); - trainer.train_one_step(train_image.get_image_data(), train_image.get_image_labels()); network.clean(); serialize("mnist_network.dat") << network;