Skip to content

Commit 205af5b

Browse files
authored
ready for 3.0.0 release (#1956)
1 parent 0b2c363 commit 205af5b

10 files changed

+503
-200
lines changed

autokeras/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from autokeras.tuners import Hyperband
5252
from autokeras.tuners import RandomSearch
5353

54-
__version__ = "3.0.0dev"
54+
__version__ = "3.0.0"
5555

5656
CUSTOM_OBJECTS = {
5757
"CastToFloat32": CastToFloat32,

docs/ipynb/customized.ipynb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"!export KERAS_BACKEND=\"torch\"\n",
1112
"!pip install autokeras"
1213
]
1314
},
@@ -135,20 +136,11 @@
135136
"the validation data, please refer to the Validation Data section of the\n",
136137
"tutorials of [Image\n",
137138
"Classification](/tutorial/image_classification/#validation-data), [Text\n",
138-
"Classification](/tutorial/text_classification/#validation-data),\n",
139+
"Classification](/tutorial/text_classification/#validation-data), [Structured\n",
140+
"Data\n",
141+
"Classification](/tutorial/structured_data_classification/#validation-data),\n",
139142
"[Multi-task and Multiple Validation](/tutorial/multi/#validation-data).\n",
140143
"\n",
141-
"## Data Format\n",
142-
"You can refer to the documentation of\n",
143-
"[ImageInput](/node/#imageinput-class),\n",
144-
"[TextInput](/node/#textinput-class),\n",
145-
"[RegressionHead](/block/#regressionhead-class),\n",
146-
"[ClassificationHead](/block/#classificationhead-class),\n",
147-
"for the format of different types of data.\n",
148-
"You can also refer to the Data Format section of the tutorials of\n",
149-
"[Image Classification](/tutorial/image_classification/#data-format),\n",
150-
"[Text Classification](/tutorial/text_classification/#data-format).\n",
151-
"\n",
152144
"## Implement New Block\n",
153145
"\n",
154146
"You can extend the [Block](/base/#block-class)\n",
@@ -229,6 +221,7 @@
229221
"[ImageInput](/node/#imageinput-class),\n",
230222
"[Input](/node/#input-class),\n",
231223
"[TextInput](/node/#textinput-class).\n",
224+
"[StructuredDataInput](/node/#structureddatainput-class),\n",
232225
"\n",
233226
"**Preprocessors**:\n",
234227
"[FeatureEngineering](/block/#featureengineering-class),\n",
@@ -239,14 +232,16 @@
239232
"**Blocks**:\n",
240233
"[ConvBlock](/block/#convblock-class),\n",
241234
"[DenseBlock](/block/#denseblock-class),\n",
235+
"[Embedding](/block/#embedding-class),\n",
242236
"[Merge](/block/#merge-class),\n",
243237
"[ResNetBlock](/block/#resnetblock-class),\n",
244238
"[RNNBlock](/block/#rnnblock-class),\n",
245239
"[SpatialReduction](/block/#spatialreduction-class),\n",
246240
"[TemporalReduction](/block/#temporalreduction-class),\n",
247241
"[XceptionBlock](/block/#xceptionblock-class),\n",
248242
"[ImageBlock](/block/#imageblock-class),\n",
249-
"[TextBlock](/block/#textblock-class).\n"
243+
"[TextBlock](/block/#textblock-class).\n",
244+
"[StructuredDataBlock](/block/#structureddatablock-class),\n"
250245
]
251246
}
252247
],

docs/ipynb/export.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"!export KERAS_BACKEND=\"torch\"\n",
1112
"!pip install autokeras"
1213
]
1314
},

docs/ipynb/image_classification.ipynb

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"!export KERAS_BACKEND=\"torch\"\n",
1112
"!pip install autokeras"
1213
]
1314
},
@@ -19,7 +20,6 @@
1920
},
2021
"outputs": [],
2122
"source": [
22-
"import numpy as np\n",
2323
"from keras.datasets import mnist\n",
2424
"\n",
2525
"import autokeras as ak"
@@ -225,64 +225,6 @@
225225
"clf.fit(x_train, y_train, epochs=1)"
226226
]
227227
},
228-
{
229-
"cell_type": "markdown",
230-
"metadata": {
231-
"colab_type": "text"
232-
},
233-
"source": [
234-
"## Data Format\n",
235-
"The AutoKeras ImageClassifier is quite flexible for the data format.\n",
236-
"\n",
237-
"For the image, it accepts data formats both with and without the channel\n",
238-
"dimension. The images in the MNIST dataset do not have the channel dimension.\n",
239-
"Each image is a matrix with shape (28, 28). AutoKeras also accepts images of\n",
240-
"three dimensions with the channel dimension at last, e.g., (32, 32, 3), (28,\n",
241-
"28, 1).\n",
242-
"\n",
243-
"For the classification labels, AutoKeras accepts both plain labels, i.e.\n",
244-
"strings or integers, and one-hot encoded encoded labels, i.e. vectors of 0s and\n",
245-
"1s.\n",
246-
"\n",
247-
"So if you prepare your data in the following way, the ImageClassifier should\n",
248-
"still work.\n"
249-
]
250-
},
251-
{
252-
"cell_type": "code",
253-
"execution_count": 0,
254-
"metadata": {
255-
"colab_type": "code"
256-
},
257-
"outputs": [],
258-
"source": [
259-
"(x_train, y_train), (x_test, y_test) = mnist.load_data()\n",
260-
"\n",
261-
"# Reshape the images to have the channel dimension.\n",
262-
"x_train = x_train.reshape(x_train.shape + (1,))\n",
263-
"x_test = x_test.reshape(x_test.shape + (1,))\n",
264-
"\n",
265-
"# One-hot encode the labels.\n",
266-
"eye = np.eye(10)\n",
267-
"y_train = eye[y_train]\n",
268-
"y_test = eye[y_test]\n",
269-
"\n",
270-
"print(x_train.shape) # (60000, 28, 28, 1)\n",
271-
"print(y_train.shape) # (60000, 10)\n",
272-
"print(y_train[:3])\n",
273-
"# array([[0., 0., 0., 0., 0., 1., 0., 0., 0., 0.],\n",
274-
"# [1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n",
275-
"# [0., 0., 0., 0., 1., 0., 0., 0., 0., 0.]])\n",
276-
"\n",
277-
"clf = ak.ImageClassifier(overwrite=True, max_trials=1)\n",
278-
"# Feed the Dataset to the classifier.\n",
279-
"clf.fit(x=x_train, y=y_train, epochs=1)\n",
280-
"# Predict with the best model.\n",
281-
"predicted_y = clf.predict(x=x_test)\n",
282-
"# Evaluate the best model with testing data.\n",
283-
"print(clf.evaluate(x=x_test, y=y_test))"
284-
]
285-
},
286228
{
287229
"cell_type": "markdown",
288230
"metadata": {

docs/ipynb/image_regression.ipynb

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"!export KERAS_BACKEND=\"torch\"\n",
1112
"!pip install autokeras"
1213
]
1314
},
@@ -228,57 +229,6 @@
228229
"reg.fit(x_train, y_train, epochs=1)"
229230
]
230231
},
231-
{
232-
"cell_type": "markdown",
233-
"metadata": {
234-
"colab_type": "text"
235-
},
236-
"source": [
237-
"## Data Format\n",
238-
"The AutoKeras ImageRegressor is quite flexible for the data format.\n",
239-
"\n",
240-
"For the image, it accepts data formats both with and without the channel\n",
241-
"dimension. The images in the MNIST dataset do not have the channel dimension.\n",
242-
"Each image is a matrix with shape (28, 28). AutoKeras also accepts images of\n",
243-
"three dimensions with the channel dimension at last, e.g., (32, 32, 3), (28,\n",
244-
"28, 1).\n",
245-
"\n",
246-
"For the regression targets, it should be a vector of numerical values.\n",
247-
"AutoKeras accepts numpy.ndarray.\n"
248-
]
249-
},
250-
{
251-
"cell_type": "code",
252-
"execution_count": 0,
253-
"metadata": {
254-
"colab_type": "code"
255-
},
256-
"outputs": [],
257-
"source": [
258-
"(x_train, y_train), (x_test, y_test) = mnist.load_data()\n",
259-
"x_train = x_train[:100]\n",
260-
"y_train = y_train[:100]\n",
261-
"x_test = x_test[:100]\n",
262-
"y_test = y_test[:100]\n",
263-
"\n",
264-
"# Reshape the images to have the channel dimension.\n",
265-
"x_train = x_train.reshape(x_train.shape + (1,))\n",
266-
"x_test = x_test.reshape(x_test.shape + (1,))\n",
267-
"y_train = y_train.reshape(y_train.shape + (1,))\n",
268-
"y_test = y_test.reshape(y_test.shape + (1,))\n",
269-
"\n",
270-
"print(x_train.shape) # (60000, 28, 28, 1)\n",
271-
"print(y_train.shape) # (60000, 10)\n",
272-
"\n",
273-
"reg = ak.ImageRegressor(overwrite=True, max_trials=1)\n",
274-
"# Feed the Dataset to the regressor.\n",
275-
"reg.fit(x_train, y_train, epochs=1)\n",
276-
"# Predict with the best model.\n",
277-
"predicted_y = reg.predict(x_test)\n",
278-
"# Evaluate the best model with testing data.\n",
279-
"print(reg.evaluate(x_test, y_test))"
280-
]
281-
},
282232
{
283233
"cell_type": "markdown",
284234
"metadata": {

docs/ipynb/multi.ipynb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"!export KERAS_BACKEND=\"torch\"\n",
1112
"!pip install autokeras"
1213
]
1314
},
@@ -296,18 +297,6 @@
296297
"colab_type": "text"
297298
},
298299
"source": [
299-
"## Data Format\n",
300-
"You can refer to the documentation of\n",
301-
"[ImageInput](/node/#imageinput-class),\n",
302-
"[Input](/node/#input-class),\n",
303-
"[TextInput](/node/#textinput-class),\n",
304-
"[RegressionHead](/block/#regressionhead-class),\n",
305-
"[ClassificationHead](/block/#classificationhead-class),\n",
306-
"for the format of different types of data.\n",
307-
"You can also refer to the Data Format section of the tutorials of\n",
308-
"[Image Classification](/tutorial/image_classification/#data-format),\n",
309-
"[Text Classification](/tutorial/text_classification/#data-format),\n",
310-
"\n",
311300
"## Reference\n",
312301
"[AutoModel](/auto_model/#automodel-class),\n",
313302
"[ImageInput](/node/#imageinput-class),\n",

0 commit comments

Comments
 (0)