Author | Project | Documentation | Build Status | Code Quality | Coverage |
---|---|---|---|---|---|
N. Curti M. Ceccarelli |
NumPyNet | Linux/MacOS : Windows : |
Codacy : Codebeat : |
</a>
Neural Networks in Pure NumPy - NumPyNet
Implementation in pure Numpy
of neural networks models.
NumPyNet
supports a syntax very close to the Keras
one but it is written using only Numpy
functions: in this way it is very light and fast to install and use/modify.
Table of Contents
Introduction
TODO: Insert here introduction about neural network models starting from the Simple Perceptron model provided here
Layers are the main core of a Neural Network model: every one of them performs, on its respective input, a different operation. The concatenation of multiple Layer forms a CNN, where for concatenation we mean that the output of a layer becomes the input of the next one.
In the NumPyNet
framework a Layer is a python class
, this allows the users to instantiate an object of the chosen type and call one of its methods.
Main Method:
-
forward : this function is defined for every Layer and it performs the so-called forward pass, that is the implementation of the transformation the Layer performs on the Input. It usually receives as argument just the output of the previous Layer.
-
backward : this function is defined for every Layer and it performs the so-called backward pass, that is an implementation of the BackPropagation algorithm for the error. It computes the delta to be back-propagated during training and, eventually, the updates to trainable weights It usually receives as input only the global delta of the network, on which it performs a transformation, depending on the layer.
-
update : this function is defined only for layers with trainable weights.
Layers
Some texts for introduction:
- Activation Layer
- Avgpool Layer
- BatchNorm Layer
- Connected Layer
- Convolutional Layer
- Cost Layer
- DropOut Layer
- Input Layer
- L1norm Layer
- L2norm Layer
- Logistic Layer
- LSTM Layer : TODO
- MaxPool Layer
- RNN Layer : TODO
- Route Layer
- PixelShuffle Layer
- Shortcut Layer
- UpSample Layer
- YOLO Layer
Installation
Python version supported :
First of all ensure that a right Python version is installed (Python >= 2.7 is required). The Anaconda/Miniconda python version is recommended.
Note: some utilities (e.g image and video objects) required OpenCV library.
OpenCV does not support Python2.6
and Python3.3
.
If you are working with these two versions, please consider to remove the utilities objects or simply convert the OpenCV dependencies with other packages (like Pillow or scikit-image).
Download the project or the latest release:
git clone https://github.com/Nico-Curti/NumPyNet
cd NumPyNet
The principal NumPyNet
requirements are numpy
, matplotlib
, enum34
and configparser
.
For layer visualizations we use the Pillow
package while the OpenCV
library is used to wrap some useful image processing objects.
You can simply install the full list of requirements with the command:
pip install -r ./requirements.txt
The testing procedure of this library is performed using PyTest
and Hypothesis
packages.
Please consider to install also these libraries if you want a complete installation of NumPyNet
.
In the NumPyNet
directory execute:
python setup.py install
or for installing in development mode:
python setup.py develop --user
Testing
A full set of testing functions is provided in the testing directory.
The tests are performed against the Keras
implementation of the same functions (we tested only the Tensorflow
backend in our simulations).
You can run the full list of tests with:
cd NumPyNet/testing
pytest
The continuous integration using Travis
and Appveyor
tests each function in every commit, thus pay attention to the status badges before use this package or use the latest stable version available.
Contribution
Any contribution is more than welcome :heart:. Just fill an issue or a pull request and we will check ASAP!
See here for further informations about how to contribute with this project.
References
1- Travis Oliphant. "NumPy: A guide to NumPy", USA: Trelgol Publishing, 2006.
2- Bradski, G. "The OpenCV Library", Dr. Dobb's Journal of Software Tools, 2000.
TODO
Authors
See also the list of contributors who participated in this project.
License
The NumPyNet
package is licensed under the MIT “Expat” License.
Acknowledgment
Thanks goes to all contributors of this project.
Citation
If you have found NumPyNet
helpful in your research, please consider citing this project repository
@misc{NumPyNet,
author = {Curti, Nico and Ceccarelli, Mattia},
title = {NumPyNet},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/Nico-Curti/NumPyNet}},
}