# Lecture 7
## Topic
In this lecture we fine tune transformer models and use a GPU for the first time.
## Lecture Slides
```{raw} html
```
```{eval-rst}
:download:`Download the slides <_static/bld/pdfs/lecture_7.pdf>`
```
## Exercises
```{toctree}
---
maxdepth: 1
---
bld/notebooks/exercises/exercise_7.ipynb
bld/notebooks/solutions/exercise_7.ipynb
```
## Suggested Homework
- Fine tune a model an CPUs and GPUs and compare the speed
- Finish all the exercises you could not solve in class
- Think about a final project you could tackle with the skills you already have
## Additional materials
### Natural Language Processing with transformers
The book [Natural language processing with transformers](https://www.oreilly.com/library/view/natural-language-processing/9781098136789/) has served as basis for many of the course materials.
Chapter 2 covers the material of this lecture.
### Why are GPUs used for deep learning
This is a purely optional video that gives you some more background and analogies that
might be helpful to understad why GPUs are used for deep learning.
### Video introduction to the huggingface Trainer
This video introduction by one of the authors of the Transformers book goes deeper than
what we did in class and shows you how to deal with class imbalance. It uses the same
example dataset as in class.