Skip to content

Commit 877d55e

Browse files
committed
Fix images for github notebook viewer
1 parent 365ea20 commit 877d55e

File tree

1 file changed

+57
-50
lines changed

1 file changed

+57
-50
lines changed

samples/core/get_started/eager.ipynb

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,15 @@
195195
"* Iris virginica\n",
196196
"* Iris versicolor\n",
197197
"\n",
198-
"<figure>\n",
199-
" <img src=\"https://www.tensorflow.org/images/iris_three_species.jpg\"\n",
200-
" alt=\"Petal geometry compared for three iris species: Iris setosa, Iris virginica, and Iris versicolor\">\n",
201-
" <figcaption>\n",
202-
" **Figure 1.** [Iris setosa](https://commons.wikimedia.org/w/index.php?curid=170298) (by [Radomil](https://commons.wikimedia.org/wiki/User:Radomil), CC BY-SA 3.0), [Iris versicolor](https://commons.wikimedia.org/w/index.php?curid=248095) (by [Dlanglois](https://commons.wikimedia.org/wiki/User:Dlanglois), CC BY-SA 3.0), and [Iris virginica](https://www.flickr.com/photos/33397993@N05/3352169862) (by [Frank Mayfield](https://www.flickr.com/photos/33397993@N05), CC BY-SA 2.0).\n",
203-
" </figcaption>\n",
204-
"</figure>\n",
198+
"<table>\n",
199+
" <tr><td>\n",
200+
" <img src=\"https://www.tensorflow.org/images/iris_three_species.jpg\"\n",
201+
" alt=\"Petal geometry compared for three iris species: Iris setosa, Iris virginica, and Iris versicolor\">\n",
202+
" </td></tr>\n",
203+
" <tr><td align=\"center\">\n",
204+
" <b>Figure 1.</b> <a href=\"https://commons.wikimedia.org/w/index.php?curid=170298\">Iris setosa</a> (by <a href=\"https://commons.wikimedia.org/wiki/User:Radomil\">Radomil</a>, CC BY-SA 3.0), <a href=\"https://commons.wikimedia.org/w/index.php?curid=248095\">Iris versicolor</a>, (by <a href=\"https://commons.wikimedia.org/wiki/User:Dlanglois\">Dlanglois</a>, CC BY-SA 3.0), and <a href=\"https://www.flickr.com/photos/33397993@N05/3352169862\">Iris virginica</a> (by <a href=\"https://www.flickr.com/photos/33397993@N05\">Frank Mayfield</a>, CC BY-SA 2.0).<br/>&nbsp;\n",
205+
" </td></tr>\n",
206+
"</table>\n",
205207
"\n",
206208
"Fortunately, someone has already created a [data set of 120 Iris flowers](https://en.wikipedia.org/wiki/Iris_flower_data_set) with the sepal and petal measurements. This is a classic dataset that is popular for beginner machine learning classification problems."
207209
]
@@ -398,13 +400,15 @@
398400
"\n",
399401
"We need to select the kind of model to train. There are many types of models and picking a good one takes experience. This tutorial uses a neural network to solve the Iris classification problem. *[Neural networks](https://developers.google.com/machine-learning/glossary/#neural_network)* can find complex relationships between features and the label. It is a highly-structured graph, organized into one or more *[hidden layers](https://developers.google.com/machine-learning/glossary/#hidden_layer)*. Each hidden layer consists of one or more *[neurons](https://developers.google.com/machine-learning/glossary/#neuron)*. There are several categories of neural networks and this program uses a dense, or *[fully-connected neural network](https://developers.google.com/machine-learning/glossary/#fully_connected_layer)*: the neurons in one layer receive input connections from *every* neuron in the previous layer. For example, Figure 2 illustrates a dense neural network consisting of an input layer, two hidden layers, and an output layer:\n",
400402
"\n",
401-
"<figure>\n",
402-
" <img src=\"https://www.tensorflow.org/images/custom_estimators/full_network.png\"\n",
403-
" alt=\"A diagram of the network architecture: Inputs, 2 hidden layers, and outputs\">\n",
404-
" <figcaption>\n",
405-
" **Figure 2.** A neural network with features, hidden layers, and predictions.\n",
406-
" </figcaption>\n",
407-
"</figure>\n",
403+
"<table>\n",
404+
" <tr><td>\n",
405+
" <img src=\"https://www.tensorflow.org/images/custom_estimators/full_network.png\"\n",
406+
" alt=\"A diagram of the network architecture: Inputs, 2 hidden layers, and outputs\">\n",
407+
" </td></tr>\n",
408+
" <tr><td align=\"center\">\n",
409+
" <b>Figure 2.</b> A neural network with features, hidden layers, and predictions.<br/>&nbsp;\n",
410+
" </td></tr>\n",
411+
"</table>\n",
408412
"\n",
409413
"When the model from Figure 2 is trained and fed an unlabeled example, it yields three predictions: the likelihood that this flower is the given Iris species. This prediction is called *[inference](https://developers.google.com/machine-learning/crash-course/glossary#inference)*. For this example, the sum of the output predictions are 1.0. In Figure 2, this prediction breaks down as: `0.03` for *Iris setosa*, `0.95` for *Iris versicolor*, and `0.02` for *Iris virginica*. This means that the model predicts—with 95% probability—that an unlabeled example flower is an *Iris versicolor*."
410414
]
@@ -532,12 +536,15 @@
532536
"\n",
533537
"An *[optimizer](https://developers.google.com/machine-learning/crash-course/glossary#optimizer)* applies the computed gradients to the model's variables to minimize the `loss` function. You can think of a curved surface (see Figure 3) and we want to find its lowest point by walking around. The gradients point in the direction of steepest the ascent—so we'll travel the opposite way and move down the hill. By iteratively calculating the loss and gradients for each *step* (or *[learning rate](https://developers.google.com/machine-learning/crash-course/glossary#learning_rate)*), we'll adjust the model during training. Gradually, the model will find the best combination of weights and bias to minimize loss. And the lower the loss, the better the model's predictions.\n",
534538
"\n",
535-
"<figure>\n",
536-
" <img src=\"http://cs231n.github.io/assets/nn3/opt1.gif\" alt=\"\" width=\"45%\">\n",
537-
" <figcaption>\n",
538-
" **Figure 3.** Optimization algorthims visualized over time in 3D space. (Source: [Stanford class CS231n](http://cs231n.github.io/neural-networks-3/), MIT License)\n",
539-
" </figcaption>\n",
540-
"</figure>\n",
539+
"<table>\n",
540+
" <tr><td>\n",
541+
" <img src=\"http://cs231n.github.io/assets/nn3/opt1.gif\" width=\"70%\"\n",
542+
" alt=\"Optimization algorthims visualized over time in 3D space.\">\n",
543+
" </td></tr>\n",
544+
" <tr><td align=\"center\">\n",
545+
" <b>Figure 3.</b> Optimization algorthims visualized over time in 3D space. (Source: <a href=\"http://cs231n.github.io/neural-networks-3/\">Stanford class CS231n</a>, MIT License)<br/>&nbsp;\n",
546+
" </td></tr>\n",
547+
"</table>\n",
541548
"\n",
542549
"TensorFlow has many [optimization algorithms](https://www.tensorflow.org/api_guides/python/train) available for training. This model uses the [tf.train.GradientDescentOptimizer](https://www.tensorflow.org/api_docs/python/tf/train/GradientDescentOptimizer) that implements the *[standard gradient descent](https://developers.google.com/machine-learning/crash-course/glossary#gradient_descent)* (SGD) algorithm. The `learning_rate` sets the step size to take for each iteration down the hill. This is a *hyperparameter* that you'll commonly adjust to achieve better results."
543550
]
@@ -693,36 +700,36 @@
693700
"\n",
694701
"*Evaluating* means determining how effectively the model makes predictions. To determine the model's effectiveness at Iris classification, pass some sepal and petal measurements to the model and ask the model to predict what Iris species they represent. Then compare the model's prediction against the actual label. For example, a model that picked the correct species on half the input examples has an *[accuracy](https://developers.google.com/machine-learning/glossary/#accuracy)* of `0.5`. Figure 4 shows a slightly more effective model, getting 4 out of 5 predictions correct at 80% accuracy:\n",
695702
"\n",
696-
"<figure>\n",
697-
" <table cellpadding=\"8\" border=\"0\">\n",
698-
" <colgroup>\n",
699-
" <col span=\"4\" >\n",
700-
" <col span=\"1\" bgcolor=\"lightblue\">\n",
701-
" <col span=\"1\" bgcolor=\"lightgreen\">\n",
702-
" </colgroup>\n",
703-
" <tr bgcolor=\"lightgray\">\n",
704-
" <th colspan=\"4\">Example features</th>\n",
705-
" <th colspan=\"1\">Label</th>\n",
706-
" <th colspan=\"1\" >Model prediction</th>\n",
707-
" </tr>\n",
708-
" <tr>\n",
709-
" <td>5.9</td><td>3.0</td><td>4.3</td><td>1.5</td><td align=\"center\">1</td><td align=\"center\">1</td>\n",
710-
" </tr>\n",
711-
" <tr>\n",
712-
" <td>6.9</td><td>3.1</td><td>5.4</td><td>2.1</td><td align=\"center\">2</td><td align=\"center\">2</td>\n",
713-
" </tr>\n",
714-
" <tr>\n",
715-
" <td>5.1</td><td>3.3</td><td>1.7</td><td>0.5</td><td align=\"center\">0</td><td align=\"center\">0</td>\n",
716-
" </tr>\n",
717-
" <tr>\n",
718-
" <td>6.0</td> <td>3.4</td> <td>4.5</td> <td>1.6</td> <td align=\"center\">1</td><td align=\"center\" bgcolor=\"red\">2</td>\n",
719-
" </tr>\n",
720-
" <tr>\n",
721-
" <td>5.5</td><td>2.5</td><td>4.0</td><td>1.3</td><td align=\"center\">1</td><td align=\"center\">1</td>\n",
722-
" </tr>\n",
723-
" </table>\n",
724-
" <figcaption>**Figure 4.** An Iris classifier that is 80% accurate.</figcaption>\n",
725-
"</figure>"
703+
"<table cellpadding=\"8\" border=\"0\">\n",
704+
" <colgroup>\n",
705+
" <col span=\"4\" >\n",
706+
" <col span=\"1\" bgcolor=\"lightblue\">\n",
707+
" <col span=\"1\" bgcolor=\"lightgreen\">\n",
708+
" </colgroup>\n",
709+
" <tr bgcolor=\"lightgray\">\n",
710+
" <th colspan=\"4\">Example features</th>\n",
711+
" <th colspan=\"1\">Label</th>\n",
712+
" <th colspan=\"1\" >Model prediction</th>\n",
713+
" </tr>\n",
714+
" <tr>\n",
715+
" <td>5.9</td><td>3.0</td><td>4.3</td><td>1.5</td><td align=\"center\">1</td><td align=\"center\">1</td>\n",
716+
" </tr>\n",
717+
" <tr>\n",
718+
" <td>6.9</td><td>3.1</td><td>5.4</td><td>2.1</td><td align=\"center\">2</td><td align=\"center\">2</td>\n",
719+
" </tr>\n",
720+
" <tr>\n",
721+
" <td>5.1</td><td>3.3</td><td>1.7</td><td>0.5</td><td align=\"center\">0</td><td align=\"center\">0</td>\n",
722+
" </tr>\n",
723+
" <tr>\n",
724+
" <td>6.0</td> <td>3.4</td> <td>4.5</td> <td>1.6</td> <td align=\"center\">1</td><td align=\"center\" bgcolor=\"red\">2</td>\n",
725+
" </tr>\n",
726+
" <tr>\n",
727+
" <td>5.5</td><td>2.5</td><td>4.0</td><td>1.3</td><td align=\"center\">1</td><td align=\"center\">1</td>\n",
728+
" </tr>\n",
729+
" <tr><td align=\"center\" colspan=\"6\">\n",
730+
" <b>Figure 4.</b> An Iris classifier that is 80% accurate.<br/>&nbsp;\n",
731+
" </td></tr>\n",
732+
"</table>"
726733
]
727734
},
728735
{

0 commit comments

Comments
 (0)