0_NumpyTutorial
0_NumpyTutorial
K. Breininger, V. Christlein, Z. Yang, L. Rist, M. Nau, S. Jaganathan, C. Liu, N. Maul, L. Folle, M. Zinnen,
K. Packhäuser
Pattern Recognition Lab, Friedrich-Alexander University of Erlangen-Nürnberg
October 20, 2023
Who are we? - Lab Members
• in StudOn
• via the tutors mailing list: [email protected]
• in MS Teams
Important: Don’t hesitate to ask questions/give comments!
• Five exercises:
0. Python + Numpy Recap and Data Generation
1. Fully Connected Networks
2. CNNs and Optimization
3. Regularization and Recurrent Neural Networks
4. Image Classification with PyTorch
• Platform: MS Teams
• Five exercises:
0. Python + Numpy Recap and Data Generation
1. Fully Connected Networks
2. CNNs and Optimization
3. Regularization and Recurrent Neural Networks
4. Image Classification with PyTorch
• Platform: MS Teams
• Materials available in StudOn
• Each exercise takes 2-4 weeks → start early, submit early
• Bonus points for exam up to 10% (6 points). Unittests coverage determines
your bonus points.
• Written exam (mock exam available in StudOn)
Date Event
23.10.2023 Handout all exercises
10.11.2023 Deadline Ex.0
24.11.2023 Deadline Ex.1
15.12.2023 Deadline Ex.2
19.01.2024 Deadline Ex.3
09.02.2024 Deadline Ex.4
• Percentage next to Ex0 represents the bonus points in the exam (here 1%)
• E.g., TestCircle contributes with 10% to the 1% (resulting in 0.1% for the
exam)
• TestGen seems important with 70% and hence causes the most effort
• TestGen contains also more unittests than the others.
Example of bonus table for ex0. Tutors will assign your bonus points base on this table. See Description.pdf how
to run this table.
Our recommmendation:
Do them all! Why?
1. You do not get confused by dependencies (it’s easier to keep an overview if
you do them all)
Our recommmendation:
Do them all! Why?
1. You do not get confused by dependencies (it’s easier to keep an overview if
you do them all)
2. It is easier to get used to the framework if you do everything
Our recommmendation:
Do them all! Why?
1. You do not get confused by dependencies (it’s easier to keep an overview if
you do them all)
2. It is easier to get used to the framework if you do everything
3. You get the maximum of bonus points - 10% (tentatively two grades).
Our recommmendation:
Do them all! Why?
1. You do not get confused by dependencies (it’s easier to keep an overview if
you do them all)
2. It is easier to get used to the framework if you do everything
3. You get the maximum of bonus points - 10% (tentatively two grades).
4. We will cover content for the exam - thus highly relevant!
Our recommmendation:
Do them all! Why?
1. You do not get confused by dependencies (it’s easier to keep an overview if
you do them all)
2. It is easier to get used to the framework if you do everything
3. You get the maximum of bonus points - 10% (tentatively two grades).
4. We will cover content for the exam - thus highly relevant!
5. Perform way better in the exam
Figure: performance of 267 students from SS22. Students who completed all exercises perform much better than
students who haven’t completed the exercises
Often it is not possible or desired to train your neural network on the whole data set
at once. → Divide your data into smaller portions.
Use numpy to implement an image generator class which also enables data
augmentation.
• The generator yields so called batches (subsets of the training data) in an
iterative manner.
• Batch in this context means a set of images, which are returned at once (by
calling "next").
• These batches of images must be returned together with their corresponding
labels.
• It returns batches until no training samples are left. One pass through the
whole data set is also known as one epoch.