GithubHelp home page GithubHelp logo

hbcbh1999 / reprodl2021 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sscardapane/reprodl2021

0.0 1.0 0.0 148 KB

Host repository for the "Reproducible Deep Learning" PhD course

License: MIT License

Jupyter Notebook 100.00%

reprodl2021's Introduction

Reproducible Deep Learning

PhD Course in Data Science, 2021, 3 CFU

[Official website]

This practical PhD course explores the design of a simple reproducible environment for a deep learning project, using free, open-source tools (Git, DVC, Docker, Hydra, ...). The choice of tools is opinionated, and was made as a trade-off between practicality and didactical concerns.

Local set-up

The use case of the course is an audio classification model trained on the ESC-50 dataset. To set-up your local machine (or a proper virtual / remote environment), configure Anaconda, and create a clean environment:

conda create -n reprodl; conda activate reprodl

Then, install a few generic prerequisites (notebook handling, Pandas, …):

conda install -y -c conda-forge notebook matplotlib pandas ipywidgets pathlib

Finally, install PyTorch and PyTorch Lightning. The instructions below can vary depending on whether you have a CUDA-enabled machine, Linux, etc. In general, follow the instructions from the websites.

conda install -y pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c conda-forge
conda install -y pytorch-lightning -c conda-forge

This should be enough to let you run the initial notebook. More information on the use case can be found inside the notebook itself.

⚠️ For Windows only, install a backend for torchaudio:

pip install soundfile

Additional set-up steps

The following steps are not mandatory, but will considerably simplify the experience.

  1. If you are on Windows, install the Windows Subsystem for Linux. This is useful in a number of contexts, including Docker installation.
  2. We will use Git from the command line multiple times, so consider enabling GitHub access with an SSH key.
  3. We will experiment with Docker reproducibility on the Sapienza DGX environment. If you have not done so already, set-up your access to the machine.

Organization of the course

The course is split into exercises (e.g., adding DVC support). The material for each exercise is provided as a Git branch. To follow an exercise, switch to the corresponding branch, and follow the README there. If you want to see the completed exercise, add _completed to the name of the branch. Additional material and information can be found on the main website of the course.

List of exercises:

  • Experimenting with Git, branches, and scripting (exercise1_git).
  • Adding Hydra configuration (exercise2_hydra).
  • Versioning data with DVC (exercise3_dvc).
  • Creating a Dockerfile (exercise4_docker).
  • Experiment management with Weight & Biases.

An example

If you want to follow the first exercise, switch to the corresponding branch and follow the instructions from there:

git checkout exercise1_git

If you want to see the completed exercise:

git checkout exercise1_git_completed

You can inspect the commits to look at specific changes in the code:

git log --graph --abbrev-commit --decorate

If you want to inspect a specific change, you can checkout again using the ID of the commit.

Advanced reading material

If you liked the exercises and are planning to explore more, the new edition of Full Stack Deep Learning (UC Berkeley CS194-080) covers a larger set of material than this course. Another good resource (divided in small exercises) is the MLOps repository by Goku Mohandas. lucmos/nn-template is a fully-functioning template implementing many of the tools described in this course.

reprodl2021's People

Contributors

sscardapane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.