Skip to content
forked from sharadmv/deepx

An expressive shorthand to describe a deep learning architecture

License

Notifications You must be signed in to change notification settings

zhangmarvin/deepx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepX Build Status Coverage Status PyPI

DeepX is a deep learning library designed with flexibility and succinctness in mind. The key aspect is an expressive shorthand to describe your neural network architecture.

DeepX supports both Tensorflow and PyTorch.

Installation

$ pip install deepx

Quickstart

The first step in building your first network is to define your model. The model is the input-output structure of your network. Let's consider the task of classifying MNIST with a multilayer perceptron (MLP).

>>> from deepx.nn import *
>>> net = Relu(200) >> Relu(200) >> Softmax(10)

Our model behaves like a function.

>>> import tensorflow as tf
>>> net(tf.ones((10, 784)))

To get the weights out of the network, we can just say:

>>> net.get_parameters()

We can also use a convolutional neural network for classification and it'll work exactly the same!

>>> net = (Reshape([28, 28, 1])
            >> Conv([2, 2, 64])
            >> Conv([2, 2, 32])
            >> Conv([2, 2, 16])
            >> Flatten() >> Relu(200) >> Relu(200) >> Softmax(10))

That's it, we're done!

About

An expressive shorthand to describe a deep learning architecture

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%