Skip to content

Commit 7c5d2a4

Browse files
committed
Hello autokeras
0 parents  commit 7c5d2a4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
*.py[co]

app.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from keras.datasets import mnist
2+
from autokeras.image_supervised import ImageClassifier
3+
4+
5+
def main():
6+
(x_train, y_train), (x_test, y_test) = mnist.load_data()
7+
x_train = x_train.reshape(x_train.shape + (1,))
8+
x_test = x_test.reshape(x_test.shape + (1,))
9+
10+
clf = ImageClassifier(verbose=True, searcher_args={
11+
'trainer_args': {
12+
'max_iter_num': 3,
13+
}
14+
})
15+
print(clf)
16+
# clf.fit(x_train, y_train, time_limit=12 * 60 * 60)
17+
clf.fit(x_train, y_train, time_limit=10 * 60)
18+
clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
19+
y = clf.evaluate(x_test, y_test)
20+
print(y)
21+
22+
23+
if __name__ == '__main__':
24+
main()

0 commit comments

Comments
 (0)