Skip to content

Nerlnet is a distributed machine learning platform for experiments and IoT deployment.

License

Notifications You must be signed in to change notification settings

leondavi/NErlNet

Repository files navigation

NErlNet

version

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.

image image image image

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.

Introducing Nerlnet

720p_Nerlnet.Intro.mp4

Nerlnet Architecture:

Nerlnet Architecture

Build and Run Nerlnet:

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:

  1. Clone this repository with its subomdules git clone --recurse-submodules <link to this repo> NErlNet
  2. 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
  3. 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

Python API and Jupyter (For UI Server):

Minimum Python version: 3.8

  1. 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
  2. Install required modules while in venv pip install -r src_py/requirements.txt
  3. Call Jupyter environment creator script with an experiment directory ./NerlnetJupyterEnvGenerator.sh --j <experiment_direcotry>
  4. Run Jupyter notebook with jupyter-notebook and create a new notebook in the created dir from 4.
  5. Follow the example: https://github.com/leondavi/NErlNet/blob/master/examples/example_run.ipynb

Contact Email: [email protected]