Skip to content

Commit

Permalink
Added image titles (#510)
Browse files Browse the repository at this point in the history
Co-authored-by: Kavya Manocha <[email protected]>
  • Loading branch information
KavyaManocha and KavyaM19 authored Sep 18, 2024
1 parent 68b6f41 commit 9820e21
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion content/english/python-tensorflow/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}}

Expand Down
4 changes: 2 additions & 2 deletions content/english/python-tensorflow/activity-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 %}}

Expand Down
2 changes: 1 addition & 1 deletion content/english/python-tensorflow/activity-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</br>

![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")

</br>
We will adjust the labeling of the x-axis so that the data it displays is easier to understand.
Expand Down
10 changes: 5 additions & 5 deletions content/english/python-tensorflow/answer_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()])
Expand Down Expand Up @@ -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")



Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions content/english/python-tensorflow/building_neural_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

Expand All @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions content/english/python-tensorflow/plotting_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</br>
Expand All @@ -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.

Expand All @@ -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?
6 changes: 3 additions & 3 deletions content/english/python-tensorflow/progress_update_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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.
Expand All @@ -70,7 +70,7 @@ test_images = test_images / 255.0
If you would like to test the code above, visit <a href="https://colab.research.google.com/drive/1ndj0W1P_3uAG-L2a6LwxdJPSHbSK5WE6?usp=sharing" target="_blank">this link</a>

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
Expand Down
2 changes: 1 addition & 1 deletion content/english/python-tensorflow/progress_update_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions content/english/python-tensorflow/progress_update_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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 %}}

Expand Down
2 changes: 1 addition & 1 deletion content/english/python-tensorflow/wrapup.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ If you would like to test the finished code, visit
<a href="https://colab.research.google.com/drive/1NtI1_iiNvq1J9rQsEaKEbiFsotkL_C0T?usp=sharing" target="_blank">this link</a>

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 %}}

0 comments on commit 9820e21

Please sign in to comment.