lmjohns3 / theanets

Neural network toolkit for Python
http://theanets.rtfd.org
MIT License
328 stars 73 forks source link

theanets package on PyPI is broken or obsolete #97

Closed Franck-Dernoncourt closed 9 years ago

Franck-Dernoncourt commented 9 years ago

If I follow the readme:

  1. install theanets with pip install theanets
  2. try a simple example:
import climate
import theanets
from sklearn.datasets import make_classification
from sklearn.metrics import confusion_matrix

climate.enable_default_logging()

# Create a classification dataset.
X, y = make_classification(
    n_samples=3000, n_features=100, n_classes=10, n_informative=10)
X = X.astype('f')
y = y.astype('i')
cut = int(len(X) * 0.8)  # training / validation split
train = X[:cut], y[:cut]
valid = X[cut:], y[cut:]

# Build a classifier model with 100 inputs and 10 outputs.
net = theanets.Classifier(layers=[100, 10])

# Train the model using SGD with momentum.
net.train(train, valid, algo='sgd', learning_rate=1e-4, momentum=0.9)

I get: AttributeError: 'Classifier' object has no attribute 'train'.

Everything works fine if I install theanets from the current source on GitHub:

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

So I guess the theanets package on PyPI is either broken or obsolete?

lmjohns3 commented 9 years ago

The README that's visible on GitHub is always paired with the current code in the git master branch. If you want to get the examples from the GitHub README to work, you'll need to check out and install the code from git.

On the other hand, pypi has the version of the README that's paired with the most recent release: https://pypi.python.org/pypi/theanets