Skip to content

Commit

Permalink
Lecture 10: ImageInspector removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sadda committed Apr 26, 2021
1 parent f87b7cf commit ee91e3d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
ImageInspector = "b0ce21f1-0238-464b-b95f-8a4068743199"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
12 changes: 6 additions & 6 deletions docs/src/lecture_10/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Plot all images which are ``9`` but were classified as ``7``.

To plot all these misclassified images, we find their indices and use the function `imageplot`. Since `y` are stored in the 1:10 format, we need to specify `classes`.

```@example gpuu
```julia
using ImageInspector

classes = 0:9
Expand All @@ -328,7 +328,7 @@ savefig("miss.svg") # hide



![](miss.svg)
# ![](miss.svg)

We see that some of the nines could be recognized as a seven even by humans.

Expand Down Expand Up @@ -377,7 +377,7 @@ train_or_load!(file_name, m)

Before plotting, we perform a for loop over the digits. Then ```onecold(y_train, classes) .== i``` creates a ```BitArray``` with ones if the condition is satisfied, and zeros if the condition is not satisfied. Then ```findall(???)``` selects all ones, and ```???[1:5]``` finds the first five indices. Since we need to plot the original image, and the images after the second and fourth layer (there is always a convolutional layer before the pooling layer), we save these values into ```z1```, ```z2``` and ```z3```. Then we need to access to desired channels and plot then via the `ImageInspector` package.

```@example gpuu
```julia
using ImageInspector

classes = 0:9
Expand Down Expand Up @@ -412,15 +412,15 @@ We plot and comment on three selected digits below.

Digit 0

![](Layers_0.svg)
# ![](Layers_0.svg)

Digit 1

![](Layers_1.svg)
# ![](Layers_1.svg)

Digit 9

![](Layers_9.svg)
# ![](Layers_9.svg)

We may observe several things:
- The functions inside the neural network do the same operations on all samples. The second row is always a black digit on a grey background.
Expand Down
6 changes: 3 additions & 3 deletions docs/src/lecture_10/nn.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```@setup nn
using Plots
using MLDatasets
using ImageInspector
# using ImageInspector
Core.eval(Main, :(using Flux)) # hide
ENV["DATADEPS_ALWAYS_ACCEPT"] = true
Expand Down Expand Up @@ -85,7 +85,7 @@ nothing # hide

We use the `imageplot` function to plot the images. To invert the colours, we need to call it with `1 .- X_train` instead of `X_train`.

```@example nn
```julia
using Plots
using ImageInspector

Expand All @@ -98,7 +98,7 @@ savefig("mnist_intro2.svg") # hide
</p></details>
```

![](mnist_intro2.svg)
# ![](mnist_intro2.svg)



Expand Down

0 comments on commit ee91e3d

Please sign in to comment.