Skip to content
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

add missing alt-text descriptions #428

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion episodes/4-advanced-layer-types.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ plot_history(history, ['accuracy', 'val_accuracy'])
plot_history(history, ['loss', 'val_loss'])
```

![](fig/04_training_history_loss_2.png){alt: "Plot of training loss and validation loss vs epochs for the trained model"}
![](/fig/04_training_history_loss_2.png){alt="Plot of training loss and validation loss vs epochs for the trained model"}

::::
:::
Expand Down
17 changes: 12 additions & 5 deletions instructors/bonus-material.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ title: Bonus material

To apply Deep Learning to a problem there are several steps we need to go through:

![A visualisation of the Machine Learning Pipeline](../episodes/fig/graphviz/pipeline.png)

![A visualisation of the Machine Learning Pipeline](../episodes/fig/graphviz/pipeline.png){alt="A flow diagram illustrating the ten-step deep learning pipeline described in the lesson introduction."}

Feel free to use this figure as [png](../episodes/fig/graphviz/pipeline.png). The figure is contained in `fig/graphviz/` of this repository. Use the `Makefile` there in order to reproduce it in different output formats.

Expand All @@ -22,7 +23,9 @@ The name of the technique refers to a very common regularization technique: **Dr

One of the most versatile regularization technique is **dropout**.
Dropout essentially means that during each training cycle a random fraction of the dense layer nodes are turned off. This is described with the dropout rate between 0 and 1 which determines the fraction of nodes to silence at a time.
![Dropout sketch](../episodes/fig/neural_network_sketch_dropout.png)

![Dropout sketch](../episodes/fig/neural_network_sketch_dropout.png){alt='A sketch of a neural network with and without dropout'}

The intuition behind dropout is that it enforces redundancies in the network by constantly removing different elements of a network. The model can no longer rely on individual nodes and instead must create multiple "paths". In addition, the model has to make predictions with much fewer nodes and weights (connections between the nodes).
As a result, it becomes much harder for a network to memorize particular features. At first this might appear a quiet drastic approach which affects the network architecture strongly.
In practice, however, dropout is computationally a very elegant solution which does not affet training speed. And it frequently works very well.
Expand Down Expand Up @@ -95,7 +98,8 @@ plt.xlabel("epochs")
plt.ylabel("RMSE")
```

![Output of plotting sample](../episodes/fig/03_training_history_4_rmse_dropout.png)
![Output of plotting sample](../episodes/fig/03_training_history_4_rmse_dropout.png){alt='Output of plotting sample'}


In this setting overfitting seems to be pervented succesfully. The overall results though have not improved (at least not by much).
Above we have used dropout to randomly turn off network nodes during training.
Expand Down Expand Up @@ -173,7 +177,8 @@ plt.hist(y_test_predicted_ensemble[0,:], rwidth=0.9)
plt.xlabel("predicted sunshine hours")
```

![Output of plotting sample](../episodes/fig/03_monte_carlo_dropout_distribution_example.png)
![Output of plotting sample](../episodes/fig/03_monte_carlo_dropout_distribution_example.png){alt='bar plot summarising distribution of frequencies of predictions with different numbers of hours of sunshine'}


Instead of full distributions for every datapoint we might also just want to extract the mean and standard deviation.
```
Expand All @@ -189,4 +194,6 @@ plt.scatter(y_test_predicted_mean, y_test, s=40*y_test_predicted_std,
plt.xlabel("predicted")
plt.ylabel("true values")
```
![Output of plotting sample](../episodes/fig/03_scatter_plot_model_uncertainty.png)

![Output of plotting sample](../episodes/fig/03_scatter_plot_model_uncertainty.png){alt='scatter plot of mean predicted hours of sunshine against true values, colored by standard deviation of the predictions, showing some correlation between the predictions from the model and the observed data'}