Skip to main content

A library of neural nets in theano

Project description

The theanets package provides tools for defining and optimizing several common types of neural network models. It uses Python for rapid development, and under the hood Theano provides graph optimization and fast computations on the GPU.

The package defines models for classification, autoencoding, regression, and prediction. Models can easily be created with any number of feedforward or recurrent layers and combined with different regularizers:

  • L1/L2 weight decay
  • L1/L2 hidden activation penalties (e.g., sparse autoencoders)
  • Dropout/gaussian noise (e.g., denoising autoencoders)

Several optimization algorithms are also included:

At present there are no RBMs, convolutions, or maxout in theanets – for those, you might want to look at Morb, Lasagne, or pylearn2. There are many other neural networks toolkits out there as well, in many other languages; see this stackoverflow question for a few additional pointers, or just search for them.

Installation

Install the latest published code using pip:

pip install theanets

Or download the current source and run it from there:

git clone http://github.com/lmjohns3/theanets
cd theanets
python setup.py develop

Example

Let’s say you wanted to create a classifier and train it on some 100-dimensional data points that you’ve classified into 10 categories. You can define your model and train it using a few lines of code:

import climate
import theanets
import my_data_set

climate.enable_default_logging()

exp = theanets.Experiment(
    theanets.Classifier,
    layers=(100, 200, 100, 10),
    hidden_l1=0.1,
)

exp.train(
    my_data_set.training_data,
    my_data_set.validation_data,
    optimize='sgd',
    learning_rate=0.01,
    momentum=0.5,
)

exp.network.predict(my_data_set.test_data)

The trained network lets you make predictions on unseen test data.

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 theanets, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size theanets-0.5.0-py2-none-any.whl (46.5 kB) File type Wheel Python version 2.7 Upload date Hashes View hashes
Filename, size theanets-0.5.0-py3-none-any.whl (46.5 kB) File type Wheel Python version 3.4 Upload date Hashes View hashes
Filename, size theanets-0.5.0.tar.gz (41.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page