-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ready for 3.0.0 release #1956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ready for 3.0.0 release #1956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "!export KERAS_BACKEND=\"torch\"\n", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| "!pip install autokeras" | ||||||
| ] | ||||||
| }, | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "!export KERAS_BACKEND=\"torch\"\n", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| "!pip install autokeras" | ||||||
| ] | ||||||
| }, | ||||||
|
|
@@ -19,7 +20,6 @@ | |||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "import numpy as np\n", | ||||||
| "from keras.datasets import mnist\n", | ||||||
| "\n", | ||||||
| "import autokeras as ak" | ||||||
|
|
@@ -225,64 +225,6 @@ | |||||
| "clf.fit(x_train, y_train, epochs=1)" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "markdown", | ||||||
| "metadata": { | ||||||
| "colab_type": "text" | ||||||
| }, | ||||||
| "source": [ | ||||||
| "## Data Format\n", | ||||||
| "The AutoKeras ImageClassifier is quite flexible for the data format.\n", | ||||||
| "\n", | ||||||
| "For the image, it accepts data formats both with and without the channel\n", | ||||||
| "dimension. The images in the MNIST dataset do not have the channel dimension.\n", | ||||||
| "Each image is a matrix with shape (28, 28). AutoKeras also accepts images of\n", | ||||||
| "three dimensions with the channel dimension at last, e.g., (32, 32, 3), (28,\n", | ||||||
| "28, 1).\n", | ||||||
| "\n", | ||||||
| "For the classification labels, AutoKeras accepts both plain labels, i.e.\n", | ||||||
| "strings or integers, and one-hot encoded encoded labels, i.e. vectors of 0s and\n", | ||||||
| "1s.\n", | ||||||
| "\n", | ||||||
| "So if you prepare your data in the following way, the ImageClassifier should\n", | ||||||
| "still work.\n" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "code", | ||||||
| "execution_count": 0, | ||||||
| "metadata": { | ||||||
| "colab_type": "code" | ||||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "(x_train, y_train), (x_test, y_test) = mnist.load_data()\n", | ||||||
| "\n", | ||||||
| "# Reshape the images to have the channel dimension.\n", | ||||||
| "x_train = x_train.reshape(x_train.shape + (1,))\n", | ||||||
| "x_test = x_test.reshape(x_test.shape + (1,))\n", | ||||||
| "\n", | ||||||
| "# One-hot encode the labels.\n", | ||||||
| "eye = np.eye(10)\n", | ||||||
| "y_train = eye[y_train]\n", | ||||||
| "y_test = eye[y_test]\n", | ||||||
| "\n", | ||||||
| "print(x_train.shape) # (60000, 28, 28, 1)\n", | ||||||
| "print(y_train.shape) # (60000, 10)\n", | ||||||
| "print(y_train[:3])\n", | ||||||
| "# array([[0., 0., 0., 0., 0., 1., 0., 0., 0., 0.],\n", | ||||||
| "# [1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],\n", | ||||||
| "# [0., 0., 0., 0., 1., 0., 0., 0., 0., 0.]])\n", | ||||||
| "\n", | ||||||
| "clf = ak.ImageClassifier(overwrite=True, max_trials=1)\n", | ||||||
| "# Feed the Dataset to the classifier.\n", | ||||||
| "clf.fit(x=x_train, y=y_train, epochs=1)\n", | ||||||
| "# Predict with the best model.\n", | ||||||
| "predicted_y = clf.predict(x=x_test)\n", | ||||||
| "# Evaluate the best model with testing data.\n", | ||||||
| "print(clf.evaluate(x=x_test, y=y_test))" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "markdown", | ||||||
| "metadata": { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "!export KERAS_BACKEND=\"torch\"\n", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| "!pip install autokeras" | ||||||
| ] | ||||||
| }, | ||||||
|
|
@@ -228,57 +229,6 @@ | |||||
| "reg.fit(x_train, y_train, epochs=1)" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "markdown", | ||||||
| "metadata": { | ||||||
| "colab_type": "text" | ||||||
| }, | ||||||
| "source": [ | ||||||
| "## Data Format\n", | ||||||
| "The AutoKeras ImageRegressor is quite flexible for the data format.\n", | ||||||
| "\n", | ||||||
| "For the image, it accepts data formats both with and without the channel\n", | ||||||
| "dimension. The images in the MNIST dataset do not have the channel dimension.\n", | ||||||
| "Each image is a matrix with shape (28, 28). AutoKeras also accepts images of\n", | ||||||
| "three dimensions with the channel dimension at last, e.g., (32, 32, 3), (28,\n", | ||||||
| "28, 1).\n", | ||||||
| "\n", | ||||||
| "For the regression targets, it should be a vector of numerical values.\n", | ||||||
| "AutoKeras accepts numpy.ndarray.\n" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "code", | ||||||
| "execution_count": 0, | ||||||
| "metadata": { | ||||||
| "colab_type": "code" | ||||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "(x_train, y_train), (x_test, y_test) = mnist.load_data()\n", | ||||||
| "x_train = x_train[:100]\n", | ||||||
| "y_train = y_train[:100]\n", | ||||||
| "x_test = x_test[:100]\n", | ||||||
| "y_test = y_test[:100]\n", | ||||||
| "\n", | ||||||
| "# Reshape the images to have the channel dimension.\n", | ||||||
| "x_train = x_train.reshape(x_train.shape + (1,))\n", | ||||||
| "x_test = x_test.reshape(x_test.shape + (1,))\n", | ||||||
| "y_train = y_train.reshape(y_train.shape + (1,))\n", | ||||||
| "y_test = y_test.reshape(y_test.shape + (1,))\n", | ||||||
| "\n", | ||||||
| "print(x_train.shape) # (60000, 28, 28, 1)\n", | ||||||
| "print(y_train.shape) # (60000, 10)\n", | ||||||
| "\n", | ||||||
| "reg = ak.ImageRegressor(overwrite=True, max_trials=1)\n", | ||||||
| "# Feed the Dataset to the regressor.\n", | ||||||
| "reg.fit(x_train, y_train, epochs=1)\n", | ||||||
| "# Predict with the best model.\n", | ||||||
| "predicted_y = reg.predict(x_test)\n", | ||||||
| "# Evaluate the best model with testing data.\n", | ||||||
| "print(reg.evaluate(x_test, y_test))" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "cell_type": "markdown", | ||||||
| "metadata": { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
| }, | ||||||
| "outputs": [], | ||||||
| "source": [ | ||||||
| "!export KERAS_BACKEND=\"torch\"\n", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| "!pip install autokeras" | ||||||
| ] | ||||||
| }, | ||||||
|
|
@@ -296,18 +297,6 @@ | |||||
| "colab_type": "text" | ||||||
| }, | ||||||
| "source": [ | ||||||
| "## Data Format\n", | ||||||
| "You can refer to the documentation of\n", | ||||||
| "[ImageInput](/node/#imageinput-class),\n", | ||||||
| "[Input](/node/#input-class),\n", | ||||||
| "[TextInput](/node/#textinput-class),\n", | ||||||
| "[RegressionHead](/block/#regressionhead-class),\n", | ||||||
| "[ClassificationHead](/block/#classificationhead-class),\n", | ||||||
| "for the format of different types of data.\n", | ||||||
| "You can also refer to the Data Format section of the tutorials of\n", | ||||||
| "[Image Classification](/tutorial/image_classification/#data-format),\n", | ||||||
| "[Text Classification](/tutorial/text_classification/#data-format),\n", | ||||||
| "\n", | ||||||
| "## Reference\n", | ||||||
| "[AutoModel](/auto_model/#automodel-class),\n", | ||||||
| "[ImageInput](/node/#imageinput-class),\n", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
!exportcommand in a Jupyter cell only sets the environment variable for the subshell of that specific command and does not persist for the notebook's kernel. To set the environment variable for the entire notebook session, you should use the%envmagic command.