Skip to content

Instantly share code, notes, and snippets.

@FavioVazquez
Created August 7, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save FavioVazquez/f599825f42f385928f6688a08c1f7a34 to your computer and use it in GitHub Desktop.
Save FavioVazquez/f599825f42f385928f6688a08c1f7a34 to your computer and use it in GitHub Desktop.
from keras.datasets import mnist
from autokeras.classifier import ImageClassifier
if __name__ == '__main__':
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(x_train.shape + (1,))
x_test = x_test.reshape(x_test.shape + (1,))
clf = ImageClassifier(verbose=True, augment=False)
clf.fit(x_train, y_train, time_limit=12 * 60 * 60)
clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
y = clf.evaluate(x_test, y_test)
print(y * 100)
@shyamalschandra
Copy link

This should be updated to the following:

from keras.datasets import mnist
from autokeras.image.image_supervised import ImageClassifier

if __name__ == '__main__':
    (x_train, y_train), (x_test, y_test) = mnist.load_data()
    x_train = x_train.reshape(x_train.shape + (1,))
    x_test = x_test.reshape(x_test.shape + (1,))

    clf = ImageClassifier(verbose=True, augment=False)
    print('Hello!')
    clf.fit(x_train, y_train, time_limit=12 * 60 * 60)
    clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
    y = clf.evaluate(x_test, y_test)
    print(y * 100)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment