# Lecture 9 ## Topic In this lecture you learn how to train models in pytorch. We work with the same model as in lecture 8, but this time do not implement it from scratch. Instead we re-use components form Pytorch. ## Lecture Slides ```{raw} html ``` ```{eval-rst} :download:`Download the slides <_static/bld/pdfs/lecture_9.pdf>` ``` ## Exercises ```{toctree} --- maxdepth: 1 --- bld/notebooks/exercises/exercise_9.ipynb bld/notebooks/solutions/exercise_9.ipynb ``` ## Suggested Homework - Play around with different optimizers - Extend the code from the exercises to get better logging or visualization of the training process - Try out larger or smaller networks ## Additional materials ### Blogpost about optimizers This [excellent blogpost](https://www.ruder.io/optimizing-gradient-descent/) discusses all optimizers we looked at and many more. ### Sebastian Rascka's online course Units 4.3 and 4.4 of Sebastian Raschka's [free online course](https://lightning.ai/pages/courses/deep-learning-fundamentals/training-multilayer-neural-networks-overview/4-3-training-a-multilayer-neural-network-in-pytorch-part-1-5/) covers the topics of this lecture. ### How to store GitHub credentials Storing GitHub credentials means that you do not have to type in your username and password each time you push or pull from the repository. Here is the [documentation](https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git).