Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from autokeras.image.image_supervised import ImageClassifier, ImageRegressor | ||
from autokeras.image.image_supervised import ImageClassifier, ImageRegressor, PortableImageSupervised | ||
from autokeras.text.text_supervised import TextClassifier, TextRegressor | ||
from autokeras.tabular.tabular_supervised import TabularClassifier, TabularRegressor | ||
from autokeras.net_module import CnnModule, MlpModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
|
||
from keras.datasets import mnist | ||
|
||
from autokeras import ImageClassifier | ||
from autokeras.utils import pickle_from_file | ||
|
||
# Customer temp dir by your own | ||
TEMP_DIR = '/tmp/autokeras_U8KEOQ' | ||
model_file_name = os.path.join(TEMP_DIR, 'test_autokeras_model.pkl') | ||
|
||
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, path=TEMP_DIR, resume=True) | ||
clf.fit(x_train, y_train, time_limit=30 * 60) | ||
clf.final_fit(x_train, y_train, x_test, y_test) | ||
clf.export_autokeras_model(model_file_name) | ||
model = pickle_from_file(model_file_name) | ||
results = model.evaluate(x_test, y_test) | ||
print(results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters