Deep Learning Library based on pure Numpy
Project description
NumpyDL: Deep Learning Library based on Pure Numpy
NumpyDL is a simple deep learning library based on pure Python/Numpy.Its main features are:
Pure python + numpy
API like Keras deep learning library
Support basic automatic differentiation;
Support commonly used models, such as MLP, RNNs LSTMs and convnets.
Flexible network configurations and learning algorithms.
Its design is governed by several principles:
Simplicity: Be easy to use, easy to understand and easy to extend, to facilitate use in research. Interfaces should be kept small, with as few classes and methods as possible. Every added abstraction and feature should be carefully scrutinized, to determine whether the added complexity is justified.
Transparency: Native to Numpy, directly process and return Python / numpy data types. Do not rely on the functionality of Theano, Tensorflow or any such DL framework.
Modularity: Allow all parts (layers, regularizers, optimizers, …) to be used independently of NumpyDL. Make it easy to use components in isolation or in conjunction with other frameworks.
Focus: “Do one thing and do it well”. Do not try to provide a library for everything to do with deep learning.
Documentation
Available online documents: latest docs, development docs, and stable docs. Chinese version document is in development and will be available soon.
Example
import numpy as np
from sklearn.datasets import load_digits
import npdl
# prepare
npdl.utils.random.set_seed(1234)
# data
digits = load_digits()
X_train = digits.data
X_train /= np.max(X_train)
Y_train = digits.target
n_classes = np.unique(Y_train).size
# model
model = npdl.model.Model()
model.add(npdl.layers.Dense(n_out=500, n_in=64, activation=npdl.activation.ReLU()))
model.add(npdl.layers.Dense(n_out=n_classes, activation=npdl.activation.Softmax()))
model.compile(loss=npdl.objectives.SCCE(), optimizer=npdl.optimizers.SGD(lr=0.005))
# train
model.fit(X_train, npdl.utils.data.one_hot(Y_train), max_iter=150, validation_split=0.1)
Installation
Install NumpyDL using pip:
$> pip install npdl
Install from source code:
$> python setup.py install
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.