EdgeML/README.md

72 строки
3.9 KiB
Markdown
Исходник Обычный вид История

2017-08-07 00:14:26 +03:00
## Edge Machine Learning
2017-08-23 19:13:49 +03:00
2017-08-31 21:30:18 +03:00
This repository provides code for machine learning algorithms for edge devices developed at the [Microsoft Research India Lab](https://www.microsoft.com/en-us/research/project/resource-efficient-ml-for-the-edge-and-endpoint-iot-devices/).
Machine learning models need to have a small footprint in terms of battery, storage and latency to be deployed on edge devices. One example of a ubiquitous real-world application where such models are desirable is resource-scarce devices and sensors in the Internet of Things (IoT) setting. To make real-time predictions locally on IoT devices without connecting to the cloud, we need models that fit in a few kilobytes.
This repository contains two such algorithms **Bonsai** and **ProtoNN** that shine in this setting. These algorithms can train models for classical supervised learning problems with memory requirements that are orders of magnitude lower than other modern ML algorithms. The trained models can be loaded onto on edge and IoT devices/sensors, and used to make fast, precise, and accurate predictions completely offline.
For technical details, please see the ICML'17 publications on [Bonsai](publications/Bonsai.pdf) and [ProtoNN](publications/ProtoNN.pdf) algorithms.
Contributors: Initial contributions were written by Chirag Gupta, [Aditya Kusupati](https://adityakusupati.github.io/), Ashish Kumar, and [Harsha Vardhan Simhadri](http://harsha-simhadri.org).
We welcome contributions, comments and criticism. For questions, please send an [email](mailto:harshasi@microsoft.com).
2017-08-30 09:21:11 +03:00
### Requirements
2017-08-30 09:56:09 +03:00
- Linux. We developed the code on Ubuntu 16.04LTS.
2017-08-31 21:30:18 +03:00
For Windows 10 Anniversary Update or later, one can also use the Windows Subsystem for Linux.
The code can also be compiled in Windows with Visual Studio,
but this release does not include necessary makefiles yet.
2017-08-30 09:56:09 +03:00
- gcc version 5.4. Other gcc versions above 5.0 could also work.
2017-08-31 21:30:18 +03:00
- An implementation of BLAS, sparseBLAS and vector math calls.
We link with the implementation provided by the [Intel(R) Math Kernel Library](https://software.intel.com/en-us/mkl).
Please download later versions (2017v3+) of MKL as far as possible.
The code can be made to work with other math libraries with a few modifications.
2017-08-30 09:21:11 +03:00
2017-08-30 09:56:09 +03:00
### Building
2017-08-31 21:30:18 +03:00
After cloning this reposirory, set compiler and flags appropriately in `config.mk` and do:
2017-08-30 09:56:09 +03:00
```bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<MKL_PATH>:<EDGEML_ROOT>
make -j
```
Typically, MKL_PATH = /opt/intel/mkl/lib/intel64_lin/, and EDGEML_ROOT is '.'.
2017-08-31 21:30:18 +03:00
This will build two executables _Bonsai_ and _ProtoNN_.
Sample data to try these executables is not included in this repository.
2017-08-30 09:56:09 +03:00
2017-08-30 10:05:45 +03:00
### Download a sample dataset
```bash
mkdir usps10
cd usps10
wget http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/usps.bz2
wget http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/usps.t.bz2
bzip2 -d usps.bz2
bzip2 -d usps.t.bz2
mv usps train.txt
mv usps.t test.txt
2017-08-30 10:06:16 +03:00
cd <EDGEML_ROOT>
2017-08-30 10:05:45 +03:00
```
2017-08-31 21:30:18 +03:00
This will create a sample train and test dataset, on which
you can train and test Bonsai and ProtoNN algorithms.
2017-08-30 10:05:45 +03:00
For detailed instructions, see [Bonsai Readme](README_BONSAI_OSS.md) and [ProtoNN Readme](README_PROTONN_OSS.md).
2017-08-30 09:58:40 +03:00
### Makefile flags
You could change the behavior of the code by setting these flags in `config.mk` and rebuilding with `make -Bj`.
SINGLE
TIMER
LOGGER
LIGHT_LOGGER
VERBOSE
MKL_PAR/SEQ
2017-08-31 21:30:18 +03:00
Currently, MKL_SEQ_LDFLAGS is default for _Bonsai_, one can enable Parallel flag
for MKL using MKL_PAR_LDFLAGS in main Makefile. Also, float is SINGLE
precision but can be changed to DOUBLE in config.mk.
2017-08-25 13:41:25 +03:00
### Microsoft Open Source Code of Conduct
2017-08-31 21:30:18 +03:00
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.