From 9820e2151e366be07b28a0bf8584a31def993bcf Mon Sep 17 00:00:00 2001 From: KavyaManocha <59888688+KavyaManocha@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:11:45 -0700 Subject: [PATCH] Added image titles (#510) Co-authored-by: Kavya Manocha --- content/english/python-tensorflow/_index.md | 2 +- content/english/python-tensorflow/activity-2.md | 4 ++-- content/english/python-tensorflow/activity-7.md | 2 +- content/english/python-tensorflow/answer_key.md | 10 +++++----- .../python-tensorflow/building_neural_network.md | 6 +++--- content/english/python-tensorflow/plotting_model.md | 6 +++--- .../english/python-tensorflow/progress_update_1.md | 6 +++--- .../english/python-tensorflow/progress_update_2.md | 2 +- .../english/python-tensorflow/progress_update_3.md | 12 ++++++------ content/english/python-tensorflow/wrapup.md | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/content/english/python-tensorflow/_index.md b/content/english/python-tensorflow/_index.md index 2cb745726..3b9a89a05 100644 --- a/content/english/python-tensorflow/_index.md +++ b/content/english/python-tensorflow/_index.md @@ -37,7 +37,7 @@ If you do not have a Google account and are not able to create one, please conta {{% notice note %}} When running your code for the first time, make sure to run your code by clicking on _Runtime -> Run all_ in the Menu bar to execute all your code snippets sequentially. This is to make sure that you don't accidentally execute functions without importing the libraries first! -![Colab intro](media/colab_intro.png) +![Colab intro](media/colab_intro.png "Colab intro") {{% /notice %}} diff --git a/content/english/python-tensorflow/activity-2.md b/content/english/python-tensorflow/activity-2.md index e7db433d0..a851f5751 100644 --- a/content/english/python-tensorflow/activity-2.md +++ b/content/english/python-tensorflow/activity-2.md @@ -30,7 +30,7 @@ Notice that the image generated has a color bar on the left. This metric is show **Pixels** are the smallest unit of a graphic (image or display) that a screen can represent. Think of your computer screen! There are millions of tiny colored dots that when combined can create a picture of a boat or the text shown on your screen. The color bar shows the range in the color intensity that a pixel can display. -![Boot image with pixelation range from 0 to 255](../media/a2q1.png) +![Boot image with pixelation range from 0 to 255](../media/a2q1.png "Pixelated boot with color bar") {{% /notice %}} #### Question 1: @@ -40,7 +40,7 @@ After analyzing the shoe, we want to view another item from the clothing sample. Use the code in the previous code block. Then change the value of the index in `train_images[x]` to get a new image of an item. For example, if you input the index value as 7, you get the following item: -![Shirt image](../media/a2progress2.png) +![Shirt image](../media/a2progress2.png "Pixelated shirt with color bar") {{% /notice %}} diff --git a/content/english/python-tensorflow/activity-7.md b/content/english/python-tensorflow/activity-7.md index 033067edd..a70b359e4 100644 --- a/content/english/python-tensorflow/activity-7.md +++ b/content/english/python-tensorflow/activity-7.md @@ -14,7 +14,7 @@ draft: false You may remember that, when we were plotting the models, the x-axis of the graphs was labeled with the numbers 1 through 9. These correspond to the categories of items that we defined earlier in the workshop, i.e. t-shirt/top, trouser, pullover, dress, coat, sandal, shirt, sneaker, bag, and ankle boot.
-![Plotting Model Figure 2 of a sneaker](../media/Plotting_fig2.png) +![Plotting Model Figure 2 of a sneaker](../media/Plotting_fig2.png "Pixelated sneaker with color bar")
We will adjust the labeling of the x-axis so that the data it displays is easier to understand. diff --git a/content/english/python-tensorflow/answer_key.md b/content/english/python-tensorflow/answer_key.md index 599c9076a..2c6ef82f8 100644 --- a/content/english/python-tensorflow/answer_key.md +++ b/content/english/python-tensorflow/answer_key.md @@ -40,7 +40,7 @@ for i in range(42): #displays first 42 images with their class name plt.xlabel(class_names[train_labels[i]]) plt.show() #shows images with their labels ``` -![images 6x7](../media/PU2_42images.png) +![images 6x7](../media/PU2_42images.png "images 6x7 with labels") ## Activity 4 @@ -186,7 +186,7 @@ plt.colorbar() #displays the color bar on the right plt.grid(False) plt.show() #displays the entire plot ``` -![Ankle Boot](../media/a2q1.png) +![Ankle Boot](../media/a2q1.png "Ankle Boot") #### Question 1 ```python @@ -245,7 +245,7 @@ plt.colorbar() #displays the color bar on the right plt.grid(False) plt.show() #displays the entire plot ``` -![Shirt](../media/a2progress2.png) +![Shirt](../media/a2progress2.png "Shirt") ```python probability_model = tf.keras.Sequential([model, tf.keras.layers.Softmax()]) @@ -303,7 +303,7 @@ print(img.shape) plot_value_array(7, predictions_single[0], test_labels) #plot the graph containing all the class names _ = plt.xticks(range(10), class_names, rotation=45) ``` -![Classification Plot](../media/PU3_graph.png) +![Classification Plot](../media/PU3_graph.png "Classification Plot") @@ -316,7 +316,7 @@ plt.subplot(1,2,2) plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Image and Graph](../media/PU3_shirtandgraph.png) +![Image and Graph](../media/PU3_shirtandgraph.png "Image and graph") Yes, this is consistent with the previous question. diff --git a/content/english/python-tensorflow/building_neural_network.md b/content/english/python-tensorflow/building_neural_network.md index eb8e62250..ef2fe2743 100644 --- a/content/english/python-tensorflow/building_neural_network.md +++ b/content/english/python-tensorflow/building_neural_network.md @@ -18,8 +18,8 @@ In our scenario, we are using pre-labeled images of clothing to train our model. Take a look at these two images. -![Black and white sneaker with white sole](../media/NN_sneaker_ex1.png) -![Black sneaker](../media/NN_sneaker_ex2.png) +![Black and white sneaker with white sole](../media/NN_sneaker_ex1.png "Black and white sneaker with white sole") +![Black sneaker](../media/NN_sneaker_ex2.png "Black sneaker") As we can see from these images, we have two sneakers. They are both different images and their pixel values vary significantly, but we can still categorize them as sneakers. How do we do this? Our brain interprets these images by looking at patterns that we observed previously and establishes, "That is a sneaker!" @@ -41,7 +41,7 @@ The image below shows a simple implementation of a neural network. - The hidden layer consists of many neurons, which are responsible for recognizing the different patterns from the input data. These nodes then point to the output layer. - The output layer consists of a single node or multiple nodes that return an output value which the model predicts. -![Neural Network Diagram](../media/neural_network.png) +![Neural Network Diagram](../media/neural_network.png "Neural Network Diagram") Simply put, a neural network is a system, or an algorithm, that trains the computer to recognize different types of patterns. diff --git a/content/english/python-tensorflow/plotting_model.md b/content/english/python-tensorflow/plotting_model.md index e1e3eec79..c4ece3dbc 100644 --- a/content/english/python-tensorflow/plotting_model.md +++ b/content/english/python-tensorflow/plotting_model.md @@ -85,7 +85,7 @@ plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Plotting Model Figure 1 of an ankle boot](../media/Plotting_fig1.png) +![Plotting Model Figure 1 of an ankle boot](../media/Plotting_fig1.png "Plotting Model Figure 1 of an ankle boot") We can see that our model predicts this item to be an ankle boot. How confident is the model in this prediction? 99% confident. The category in paranthesis is the correct categorization of the item. In this case, the model detected the item correctly.
@@ -105,7 +105,7 @@ plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Plotting Model Figure 2 of a sneaker](../media/Plotting_fig2.png) +![Plotting Model Figure 2 of a sneaker](../media/Plotting_fig2.png "Plotting Model Figure 2 of a sneaker") From this example we see that the model predicted the item to be a sandal with 96% confidence. However, we see that the correct identification of the item is a sneaker. The plot shows that the model also predicted this item to be a sneaker with ~ 3% confidence or an ankle boot with ~ 1% confidence. @@ -128,6 +128,6 @@ for i in range(num_images): plt.tight_layout() plt.show() ``` -![Plotting Model Figure 3, 5x5 images and their model predictions](../media/Plotting_fig3.png) +![Plotting Model Figure 3, 5x5 images and their model predictions](../media/Plotting_fig3.png "Plotting Model Figure 3, 5x5 images and their model predictions") What do you think about the model's predictions? Would you be satisfied with this success rate? \ No newline at end of file diff --git a/content/english/python-tensorflow/progress_update_1.md b/content/english/python-tensorflow/progress_update_1.md index 2d3f06ed7..afd9339ec 100644 --- a/content/english/python-tensorflow/progress_update_1.md +++ b/content/english/python-tensorflow/progress_update_1.md @@ -46,7 +46,7 @@ plt.grid(False) plt.show() #displays the entire plot ``` -![Ankle Boot](../media/a2q1.png) +![Ankle Boot](../media/a2q1.png "Pixelated boot with color bar") ```python plt.figure() @@ -56,7 +56,7 @@ plt.grid(False) plt.show() #displays the entire plot ``` -![Shirt](../media/a2progress2.png) +![Shirt](../media/a2progress2.png "Pixelated shirt with color bar") ```python #the train_images and test_images range between values from 0 to 255. @@ -70,7 +70,7 @@ test_images = test_images / 255.0 If you would like to test the code above, visit this link To edit this code, click on the 'Copy to Drive' button to make a personal copy of this notebook. Make sure you are logged in to your Google account. -![Screenshot of Google Colab Notebook with "Copy to Drive button selection highighted"](../media/colab_copy.png) +![Screenshot of Google Colab Notebook with "Copy to Drive button selection highighted"](../media/colab_copy.png "Screenshot of Google Colab Notebook ") {{% notice warning %}} ### If you are using a Nuevo Google account temporarily diff --git a/content/english/python-tensorflow/progress_update_2.md b/content/english/python-tensorflow/progress_update_2.md index f0937f3ad..8ec7dc7b2 100644 --- a/content/english/python-tensorflow/progress_update_2.md +++ b/content/english/python-tensorflow/progress_update_2.md @@ -33,7 +33,7 @@ for i in range(25): #displays first 25 images with their class name plt.show() #shows images with their labels ``` -![clothing sample images, 5x5](../media/PU2_25images.png) +![clothing sample images, 5x5](../media/PU2_25images.png "Clothing sample images") ```python #Building the Neural Network diff --git a/content/english/python-tensorflow/progress_update_3.md b/content/english/python-tensorflow/progress_update_3.md index 10bed5200..7c3c11b91 100644 --- a/content/english/python-tensorflow/progress_update_3.md +++ b/content/english/python-tensorflow/progress_update_3.md @@ -59,7 +59,7 @@ plt.subplot(1,2,2) plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Plotting Figure 1](../media/Plotting_fig1.png) +![Plotting Figure 1](../media/Plotting_fig1.png "Plotting Figure 1") ```python i = 12 @@ -70,7 +70,7 @@ plt.subplot(1,2,2) plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Plotting Figure 2](../media/Plotting_fig2.png) +![Plotting Figure 2](../media/Plotting_fig2.png "Plotting Figure 2") ```python #Plotting 6 images @@ -86,7 +86,7 @@ for i in range(num_images): plt.tight_layout() plt.show() ``` -![Plotting 6 images](../media/PU3_6images.png) +![Plotting 6 images](../media/PU3_6images.png "Plotting 6 images") ```python #Plotting 25 images @@ -103,7 +103,7 @@ plt.tight_layout() plt.show() ``` -![Plotting 25 images](../media/Plotting_fig3.png) +![Plotting 25 images](../media/Plotting_fig3.png "Plotting 25 images") ```python # Grab an image from the test dataset. This shows the resolution of the image. @@ -145,7 +145,7 @@ plot_value_array(7, predictions_single[0], test_labels) #plot the graph contain _ = plt.xticks(range(10), class_names, rotation=45) ``` -![Classification Plot](../media/PU3_graph.png) +![Classification Plot](../media/PU3_graph.png "Classification Plot") ```python np.argmax(predictions_single[0]) #Verifying the index value with highest probability @@ -163,7 +163,7 @@ plt.subplot(1,2,2) plot_value_array(i, predictions[i], test_labels) plt.show() ``` -![Image and Graph](../media/PU3_shirtandgraph.png) +![Image and Graph](../media/PU3_shirtandgraph.png "Image and Graph") {{% notice info %}} diff --git a/content/english/python-tensorflow/wrapup.md b/content/english/python-tensorflow/wrapup.md index 48506811f..4ae1ba7ec 100644 --- a/content/english/python-tensorflow/wrapup.md +++ b/content/english/python-tensorflow/wrapup.md @@ -19,6 +19,6 @@ If you would like to test the finished code, visit this link To edit this code, click on the 'Copy to Drive' button to make a personal copy of this notebook. Make sure you are logged in to your Google account. -![](../media/colab_copy.png) +![](../media/colab_copy.png "Google colab") {{% /notice %}}