# Neural Networks

## Changes from 8f956ea66ea300997c1ec057bc5ff06c91cc6282 to current

```---
title: Neural Networks
categories: session
---

+ [Briefing 10 November](ANN) - Principles of training and testing
+ [Briefing 11 November](CNN) - Convolutional Networks - what are they?

+ [PyTorch Quickstart](https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html)
+ [Learn the Basics](https://pytorch.org/tutorials/beginner/basics/intro.html)
+ Szeliski 2022 Chapter 5

# Exercise 1. Basic tutorial.

I have added a couple of exercises to the official
[PyTorch Quickstart](https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html).

+ Please reflect upon and discuss the questions.

# Exercise 2. Convolutional Neural Networks

1. Complete the [CIFAR-10 Tutorial](https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html)
2. Compare the approach to Exercise 1.  What is different?
What is the same?

# Exercise 3. Evaluation and Analysis

1.  Copy the code out of the tutorials so that you can run it
in your regular environment (IDE, command line, etc.).
2.  Test one of the networks with different numbers of epochs.
Record the accuracy both on the training set and on the testing
set for each epoch.
3.  Plot the training and testing accuracy as a function of the number
of epochs.  What do you see?
4.  What is the ideal number of epochs?
5.  Calculate a confidence interval for the accuracy at the ideal
number of epochs.  What do you think of the quality of the network?
What do you think about the quality of the assessment of the network?

Note that you do not have to rerun the entire process for more epochs.
You can test the network after each epoch and continue training.

If you do not see the effect of *overtraining*, try to use smaller training sets and see how it changes the behaviour of the network.

# Exercise 4.  Different networks (optional)

Try to change the neural network in Exercise 1 and 2.
Can you improve the performance?

# Exercise 5.  More examples (optional)

Other datases may be found at