Nerlnet is an open-source library for research of distributed machine learning algorithms on IoT devices that gives full insights into both edge devices that run neural network models and network performance and statistics. Nerlnet can simulate distributed ML architectures and deploy them on various IoT devices.
Nerlnet is implemented using the following languages and libraries:
• Erlang is used for the communication layer. The implementation is based on Cowboy's http web server.
• C++ OpenNN library implements the neural network edge compute devices.
• Python manages NerlNet and gathers information from it.
A Json script defines a distributed network layout that consists the following instances:
Edge Compute Device (ECD) which is a worker that runs a neural network model.
Sensor, generates data and send it through the network.
Router that connects ECDs, sensors and other routers.
Communication with Nerlnet is done through a simple python API that can be easily used through Jupyter notebook.
The API allows the user to collect statistics insights of a distributed machine learning network:
Messages, throughput, loss, predictions, ECD performance monitor.
References and libraries:
- OpenNN, an open-source neural networks library for machine learning.
- Cowboy an HTTP server for Erlang/OTP.
- NIFPP C++11 Wrapper for Erlang NIF API.
- Rebar3, an Erlang tool that makes it easy to create, develop, and release Erlang libraries, applications, and systems in a repeatable manner.
- Simple Cpp Logger, simple cpp logger headers-only implementation.
Nerlnet is developed by David Leon, Dr. Yehuda Ben-Shimol, and the community of Nerlnet open-source contributors.
720p_Nerlnet.Intro.mp4
Recommended cmake version 3.26
Minimum erlang version otp 24
Minimum gcc/g++ version 8.4
On each machine that runs Nerlnet go through the following steps:
- Clone this repository with its subomdules
git clone --recurse-submodules <link to this repo> NErlNet
- Run
sudo ./NerlnetInstall.sh
2.1 With argument -i script builds and installs Erlang, latest stable, and CMake.
2.2 After running NerlnetInstall.sh, NErlNet directory can be accessed
via the following path:/usr/local/lib/nerlnet-lib
- Create json files of architecture, connection map and experiment flow.
json configuration files names must follow the convention of prefixes:
arch_.json, conn_.json, exp_.json.
Optional: Run ./NerlnetGetData.sh
to create or get default inputDataDir
4. Run ./NerlnetRun.sh
to start Nerlnet
Minimum Python version: 3.8
- Create and activate a virtual environment for Nerlnet: (https://docs.python.org/3/library/venv.html)
python -m venv VENV_PATH/VENV_NAME
source VENV/bin/activate
- Install required modules while in venv
pip install -r src_py/requirements.txt
- Call Jupyter environment creator script with an experiment directory
./NerlnetJupyterEnvGenerator.sh --j <experiment_direcotry>
- Run Jupyter notebook with
jupyter-notebook
and create a new notebook in the created dir from 4. - Follow the example: https://github.com/leondavi/NErlNet/blob/master/examples/example_run.ipynb
Contact Email: [email protected]