From 47b519cb5aa9a33792b2433d7dbe6c16884ffd67 Mon Sep 17 00:00:00 2001 From: lpetrov02 Date: Fri, 15 Dec 2023 09:56:59 +0300 Subject: [PATCH 1/6] Started migration from Data2dLayer to DataLayer Makes preparations for metrics logging on python Functionality for c++ http added, but not working yet Adds saving train metrics Adds saving train metrics and responding with PNG Adaptates code for new 4D blob cpprest CI support Add load possibility for zip Add load possibility for png on predict ------- GRA-122: Data loader implementation (#67) Data loader implementation ------- ID-154: Loss type selection (#70) * Add loss type selection * Add loss type selection * Remove layer-class loss * Clean up Loss type * Make format ------- ID-171: Fix input selection (#69) * Fix input selection * Clean up fix input selection ------- Change train and predict for zip file case Starts fixing train Fixes train with dataloader It's not fucking working :( (x3) server train fix Fixes train and predcit --- .github/workflows/CI.yml | 3 + .gitignore | 3 +- README.md | 3 + client/templates/main.html | 18 +- py_server/Makefile | 2 +- py_server/mlcraft/check_dimensions.py | 6 +- py_server/mlcraft/dataset.py | 14 +- py_server/mlcraft/db.py | 83 ++++++- py_server/mlcraft/server.py | 99 ++++++-- py_server/mlcraft/static/swagger.yaml | 283 ++++++++++++++++++++--- py_server/mlcraft/utils.py | 17 ++ py_server/pyproject.toml | 1 + py_server/tests/test_check_dimensions.py | 16 +- server/Makefile | 8 +- server/api/DataLoader.cpp | 26 +-- server/api/DataLoader.h | 1 + server/api/GraphBuilder.cpp | 97 ++++---- server/api/GraphBuilder.h | 27 ++- server/api/Parser.cpp | 38 +-- server/api/Parser.h | 4 +- server/api/server.cpp | 211 +++++++++++++---- server/core/Allocator.cpp | 2 +- server/core/Layer.cpp | 13 +- server/core/Layer.h | 7 +- server/core/LazyBlob.cpp | 6 +- server/core/Operation.h | 5 + server/core/Optimizer.cpp | 11 +- server/core/Optimizer.h | 12 +- server/core/Parameters.h | 5 - server/tests/linear_relu_linear_mse.json | 4 +- 30 files changed, 781 insertions(+), 244 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9798a4d5..adea88ef 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,6 +52,9 @@ jobs: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 90 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 90 + - name: install-cpprest + run: sudo apt install libcpprest-dev + - name: install-boost uses: MarkusJx/install-boost@v2.4.4 id: install-boost diff --git a/.gitignore b/.gitignore index 901ef702..48b197a5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ __pycache__/ *$py.class .cache .venv +images/ # Flask stuff: instance/ @@ -49,4 +50,4 @@ dmypy.json # Makefile install bin -*.patch \ No newline at end of file +*.patch diff --git a/README.md b/README.md index 019427b8..97c2050c 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,9 @@ Other targets available: > **Important:** If you want to build a c++ server, you need to install [Boost](https://www.boost.org/users/download/). > Then, **in the `config.json` file** add the path to the boost root (folder with `include` and `lib` inside). > For example: `"BOOST_ROOT": "/usr/local/Cellar/boost/1.81.0_1"` + +> Also you need `cpprest`: on MacOS: `brew install cpprestsdk` +> on Linux: `sudo apt-get install libcpprest-dev` > After that you should be able to build everything just fine... There are 3(4) main targets available to build: diff --git a/client/templates/main.html b/client/templates/main.html index c62663e7..01a7dfd3 100644 --- a/client/templates/main.html +++ b/client/templates/main.html @@ -174,7 +174,7 @@

- - - -