In eerste instantie maar eens alleen met de gamma spelen. Rond de 0.025 en 0.03 lijkt een betrouwbaarheid piek te zitten (97.02% bij 10.000 oefencijfers). Waarom is er geen DL-algoritme om dat optimum te bepalen? :-) Ik neem aan dat dat ook wel ergens zal zijn bedacht.
Ook is het interessant welke cijfers nou fout worden ingeschat. Na wat experimenteren met de code lukt het mij om ook daar voorbeelden van te tonen. De fouten lijken aannemelijk. Het zijn de complexere afbeeldingen. Vooral de laatste 2 rechtsonder zijn wel verrassend. Het lijkt zo beschouwd een wonder dat het convolutional netwerk uit oefening 5 in de buurt van de 99.5% komt:
![]() |
('Prediction:', array([2]), 3)
|
![]() |
('Prediction:', array([2]), 3)
|
![]() |
('Prediction:', array([6]), 1)
|
![]() |
('Prediction:', array([8]), 1
|
![]() |
('Prediction:', array([5]), 1)
|
![]() |
('Prediction:', array([6]), 5)
|
![]() |
('Prediction:', array([4]), 7)
|
![]() |
('Prediction:', array([9]), 2) ??
|
![]() |
('Prediction:', array([8]), 9)
|
![]() |
('Prediction:', array([4]), 9) ??
|
De gebruikte programmacode:
import matplotlib.pyplot as plt
import numpy as np
import time
from sklearn import svm
from load import mnist
trX, teX, trY, teY = mnist(onehot=True)
t0 = time.time()
ga = 0.027
size = 10000
clf = svm.SVC(gamma=ga, C=100)
clf.fit(trX[:size],np.argmax(trY[:size], axis=1))
print "reliability: ", np.mean(np.argmax(teY,axis=1) == clf.predict(teX)), time.time() - t0, "seconds, gamma: ", ga, " size :", size
t = 0
i = 0
while (t < 5 and i < 10000):
if (np.argmax(teY[i],axis=0) != clf.predict(teX[i])):
t += 1
print ('Prediction:', clf.predict(teX[i]), np.argmax(teY[i],axis=0), "i - " , i)
im=teX[i]
im.shape=28,28
plt.imshow(im, cmap=plt.cm.gray_r, interpolation="nearest")
plt.show()
i += 1
Geen opmerkingen:
Een reactie posten