Skip to main content

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.


Available online documents: latest docs, development docs, and stable docs. Chinese version document is in development and will be available soon.


import numpy as np
from sklearn.datasets import load_digits
import npdl

# prepare

# data
digits = load_digits()
X_train =
X_train /= np.max(X_train)
Y_train =
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,, max_iter=150, validation_split=0.1)


Install NumpyDL using pip:

$> pip install npdl

Install from source code:

$> python install

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for npdl, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size npdl-0.1.0.tar.gz (19.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page