Ugile project (authorization required)
Our project is a visual editor for neural networks designed to simplify the creation and customization of deep learning models. In a browser-accessible interface, users can intuitively assemble, configure, and optimize neural networks by dragging layers and adjusting parameters in real-time.
A key feature of the project is the ability to train models directly from the editor. The C++ server ensures high performance, allowing users to experiment with architectures and parameters. The trained neural networks generated are ready to predict outcomes for new data
Features of our project:
- Intuitive Interface: User-friendly experience thanks to an intuitively designed interface.
- Progress Saving: Capability to save the current work progress for user convenience.
- Light/Dark Themes: Personalization of the user experience.
- Custom Framework for Neural Network Training: Utilization of our own framework with automatic gradient computation for efficient neural network training.
- On-the-Spot Training and Prediction: Ability to conduct training sessions and obtain predictions directly within the neural network editor.
- Export Capabilities: The option to export created models.
- Neural Network Integrity Check: Built-in validation of the correctness of the neural network.
Important: If CI tests don't pass, but work locally, make sure your branch is updated (rebase on the current main)
Important: All Makefiles require
node
to run.
On MacOS it is justbrew install node
.
On linux runcurl -qL https://www.npmjs.com/install.sh | sudo sh
and you should be good
There is one Makefile at the project root and a Makefile for each folder (client
, py_server
, server
)
For each Makefile you can run
make help
It will give a list of all available targets and options for the current Makefile
Common Options (make <something> option1=value1 option2=value2 ...
):
- V: verbose level, if you want
make
to print what it's doing useV=2
- CONFIG_PATH: path to the
config.json
, default is the right one
Also, if you need some other options, remember that you can override any variable used in the Makefile using an option with that name.
Client has only one target. You can also provide options listed in the make help
for example:
cd client
make port=2002 V=2
Runs server on the port 2002, or just use make
to run it on the default port
Important:
npx serve
is used to host the client code (index.html
) on the port specified inconfig.json
Python server is configured to only accept requests from this port
If you run yourindex.html
as a file and will send requests to python server,CORS
won't allow you to do it
If you want to make it simple and allow Python server to accept anything, uncomment line at__init__.py:41
Make sure you have python
version at least 3.10
Important: when you first install this new build system, delete old virtual environment in
py_server
folder withrm -r .venv
. Then, if your defaultpython
command uses python version lower than 3.10, specify the python interpreter explicitly:make python=python3.10
for example. You only need to specify it explicitly once, after that make will use python from the created virtual environment.
make clean will not delete.venv
folder, so if you created it with a wrong python version, delete it and then runmake python=...
again with a correct version of python
If you see error like this on linux, when trying to create a .venv:
Error: Command '['.../.venv/bin/python3.11', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Try
sudo apt install <your python path>-venv
Then a simple make
in the py_server
directory should work
It will build you a virtual environment in the folder py_server/.venv
. Then it will install all dependencies in it
via pip
, including our own project mlcraft
.
After that, it launches mlcraft
using flask
at specified port (see make help
for all available options here).
cd py_server
make
Other targets available:
make format
: formats your code usingblack
formatter, use before commit, CI won't let you pass with unformatted codemake test
: launchmypy
typechecking and all tests fromtests
directory usingpytest
make clean
: deletes current instance folder of the app (I don't think you'll need to use it ever)
Important: If you want to build a c++ server, you need to install Boost.
Then, in theconfig.json
file add the path to the boost root (folder withinclude
andlib
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:
make
: runs thecore/main.cpp
file (use it to test your Tensor and so on...)make serve
: runs the server (api/server.cpp
)make test
: runs all the tests in thetests
directory (test file for X.cpp must be namedXTests.cpp
)make test.X
: runs a single test forX
Examples:
cd server
make serve port=4000
make test.Blob V=2 O=2
To change the compiler flags you can edit some Makefile lines about the CXXFLAGS
variable
You can build and test things from the root folder as well, but I don't think it is useful. It's done only to
conveniently run the CI
Use make help
to see available targets there
- C++
- Python
- Javascript