Very high errors on the Deep Belief network with Nolearn in Python

I am new to Nolearn and Theano in general. When I tried the Nolearn tutorial code , I get extremely high 0.9 error rates!

Why am I getting such high errors while the tutorial gets 0.005 errors? Can anyone else reproduce this issue?

Using Theano 0.7.0, Lasagne v0.1, nolearn v0.5 for OS X Yosemite.

Output

[DBN] fitting X.shape=(46900, 784) [DBN] layers [784, 300, 10] [DBN] Fine-tune... 100% Epoch 1: 100% loss 2.30829815265 err 0.901340505464 (0:00:30) Epoch 2: 100% loss 2.30304712187 err 0.902813353825 (0:00:34) Epoch 3: 100% loss 2.30303548692 err 0.90072148224 (0:00:34) Epoch 4: 100% loss 2.30297605197 err 0.902322404372 (0:00:28) Epoch 5: 100% loss 2.30295462556 err 0.901191086066 (0:00:26) Epoch 6: 100% loss 2.30293222366 err 0.898352117486 (0:00:33) Epoch 7: 100% loss 2.30283567033 err 0.901425887978 (0:00:34) Epoch 8: 100% loss 2.30283342522 err 0.90059340847 (0:00:35) Epoch 9: 100% loss 2.30283433199 err 0.902813353825 (0:00:33) Epoch 10: loss 2.30279696997 err 0.897861168033 (0:00:33) 

code

 # import the necessary packages from sklearn.cross_validation import train_test_split from sklearn.metrics import classification_report from sklearn import datasets from nolearn.dbn import DBN import numpy as np # grab the MNIST dataset (if this is the first time you are running # this script, this make take a minute -- the 55mb MNIST digit dataset # will be downloaded) print "[X] downloading data..." dataset = datasets.fetch_mldata("MNIST Original") # scale the data to the range [0, 1] and then construct the training # and testing splits (trainX, testX, trainY, testY) = train_test_split( dataset.data / 255.0, dataset.target.astype("int0"), test_size = 0.33) # train the Deep Belief Network with 784 input units (the flattened, # 28x28 grayscale image), 300 hidden units, 10 output units (one for # each possible output classification, which are the digits 1-10) dbn = DBN( [trainX.shape[1], 300, 10], learn_rates = 0.3, learn_rate_decays = 0.9, epochs = 10, verbose = 1) dbn.fit(trainX, trainY) 

Classification Report

enter image description here

+5
source share

Source: https://habr.com/ru/post/1236577/


All Articles