{"id":22013438,"url":"https://github.com/blinorot/pytorch_project_template","last_synced_at":"2025-04-07T17:11:13.028Z","repository":{"id":226777127,"uuid":"768754780","full_name":"Blinorot/pytorch_project_template","owner":"Blinorot","description":"PyTorch Template for DL projects","archived":false,"fork":false,"pushed_at":"2024-10-12T12:21:02.000Z","size":472,"stargazers_count":82,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T16:14:16.694Z","etag":null,"topics":["configuration","deep-learning","deep-learning-template","experiment-tracking","machine-learning","machine-learning-template","project","project-template","python","python-template","pytorch","pytorch-template"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blinorot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-07T17:10:19.000Z","updated_at":"2025-03-22T11:09:12.000Z","dependencies_parsed_at":"2024-04-25T10:29:51.666Z","dependency_job_id":"d2ac1626-81b6-437b-b33c-8eea41549961","html_url":"https://github.com/Blinorot/pytorch_project_template","commit_stats":null,"previous_names":["blinorot/pytorch_project_template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blinorot%2Fpytorch_project_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blinorot%2Fpytorch_project_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blinorot%2Fpytorch_project_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blinorot%2Fpytorch_project_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blinorot","download_url":"https://codeload.github.com/Blinorot/pytorch_project_template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","deep-learning","deep-learning-template","experiment-tracking","machine-learning","machine-learning-template","project","project-template","python","python-template","pytorch","pytorch-template"],"created_at":"2024-11-30T03:19:50.664Z","updated_at":"2025-04-07T17:11:13.008Z","avatar_url":"https://github.com/Blinorot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch Template for DL projects\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#about\"\u003eAbout\u003c/a\u003e •\n  \u003ca href=\"#tutorials\"\u003eTutorials\u003c/a\u003e •\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#how-to-use\"\u003eHow To Use\u003c/a\u003e •\n  \u003ca href=\"#useful-links\"\u003eUseful Links\u003c/a\u003e •\n  \u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/Blinorot/pytorch_project_template/generate\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/use%20this-template-green?logo=github\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Blinorot/pytorch_project_template/blob/main/LICENSE\"\u003e\n   \u003cimg src=https://img.shields.io/badge/license-MIT-blue.svg\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\nThis repository contains a template for [PyTorch](https://pytorch.org/)-based Deep Learning projects.\n\nThe template utilizes different python-dev techniques to improve code readability. Configuration methods enhance reproducibility and experiments control.\n\nThe repository is released as a part of the [HSE DLA course](https://github.com/markovka17/dla), however, can easily be adopted for any DL-task.\n\nThis template is the official recommended template for the [EPFL CS-433 ML Course](https://www.epfl.ch/labs/mlo/machine-learning-cs-433/).\n\n## Tutorials\n\nThis template utilizes experiment tracking techniques, such as [WandB](https://docs.wandb.ai/) and [Comet ML](https://www.comet.com/docs/v2/), and [Hydra](https://hydra.cc/docs/intro/) for the configuration. It also automatically reformats code and conducts several checks via [pre-commit](https://pre-commit.com/). If you are not familiar with these tools, we advise you to look at the tutorials below:\n\n- [Python Dev Tips](https://github.com/ebezzam/python-dev-tips): information about [Git](https://git-scm.com/doc), [pre-commit](https://pre-commit.com/), [Hydra](https://hydra.cc/docs/intro/), and other stuff for better Python code development. The YouTube recording of the workshop is available [here](https://youtu.be/okxaTuBdDuY).\n\n- [Seminar on R\u0026D Coding](https://youtu.be/sEA-Js5ZHxU): Seminar from the [LauzHack Deep Learning Bootcamp](https://github.com/LauzHack/deep-learning-bootcamp/) with template discussion and reasoning. It also explains how to work with [WandB](https://docs.wandb.ai/). The seminar materials can be found [here](https://github.com/LauzHack/deep-learning-bootcamp/blob/main/day03/Seminar_WandB_and_Coding.ipynb).\n\n- [HSE DLA Course Introduction Week](https://github.com/markovka17/dla/tree/2024/week01): combines the two seminars above into one with some updates, including an extra example for [Comet ML](https://www.comet.com/docs/v2/).\n\n- [PyTorch Basics](https://github.com/markovka17/dla/tree/2024/week01/intro_to_pytorch): several notebooks with [PyTorch](https://pytorch.org/docs/stable/index.html) basics and corresponding seminar recordings from the [LauzHack Deep Learning Bootcamp](https://github.com/LauzHack/deep-learning-bootcamp/).\n\nTo start working with a template, just click on the `use this template` button.\n\n\u003ca href=\"https://github.com/Blinorot/pytorch_project_template/generate\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/use%20this-template-green?logo=github\"\u003e\n\u003c/a\u003e\n\nYou can choose any of the branches as a starting point. [Set your choice as the default branch](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch) in the repository settings. You can also [delete unnecessary branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository).\n\n## Examples\n\n\u003e [!IMPORTANT]\n\u003e The main branch leaves some of the code parts empty or fills them with dummy examples, showing just the base structure. The final users can add code required for their own tasks.\n\nYou can find examples of this template completed for different tasks in other branches:\n\n- [Image classification](https://github.com/Blinorot/pytorch_project_template/tree/example/image-classification): simple classification problem on [MNIST](https://yann.lecun.com/exdb/mnist/) and [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html) datasets.\n\n- [ASR](https://github.com/Blinorot/pytorch_project_template/tree/example/asr): template for the automatic speech recognition (ASR) task. Some of the parts (for example, `collate_fn` and beam search for `text_encoder`) are missing for studying purposes of [HSE DLA course](https://github.com/markovka17/dla).\n\n## Installation\n\nInstallation may depend on your task. The general steps are the following:\n\n0. (Optional) Create and activate new environment using [`conda`](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) or `venv` ([`+pyenv`](https://github.com/pyenv/pyenv)).\n\n   a. `conda` version:\n\n   ```bash\n   # create env\n   conda create -n project_env python=PYTHON_VERSION\n\n   # activate env\n   conda activate project_env\n   ```\n\n   b. `venv` (`+pyenv`) version:\n\n   ```bash\n   # create env\n   ~/.pyenv/versions/PYTHON_VERSION/bin/python3 -m venv project_env\n\n   # alternatively, using default python version\n   python3 -m venv project_env\n\n   # activate env\n   source project_env\n   ```\n\n1. Install all required packages\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. Install `pre-commit`:\n   ```bash\n   pre-commit install\n   ```\n\n## How To Use\n\nTo train a model, run the following command:\n\n```bash\npython3 train.py -cn=CONFIG_NAME HYDRA_CONFIG_ARGUMENTS\n```\n\nWhere `CONFIG_NAME` is a config from `src/configs` and `HYDRA_CONFIG_ARGUMENTS` are optional arguments.\n\nTo run inference (evaluate the model or save predictions):\n\n```bash\npython3 inference.py HYDRA_CONFIG_ARGUMENTS\n```\n\n## Useful Links:\n\nYou may find the following links useful:\n\n- [Report branch](https://github.com/Blinorot/pytorch_project_template/tree/report): Guidelines for writing a scientific report/paper (with an emphasis on DL projects).\n\n- [CLAIRE Template](https://github.com/CLAIRE-Labo/python-ml-research-template): additional template by [EPFL CLAIRE Laboratory](https://www.epfl.ch/labs/claire/) that can be combined with ours to enhance experiments reproducibility via [Docker](https://www.docker.com/).\n\n- [Mamba](https://github.com/mamba-org/mamba) and [Poetry](https://python-poetry.org/): alternatives to [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) and [pip](https://pip.pypa.io/en/stable/installation/) package managers given above.\n\n- [Awesome README](https://github.com/matiassingers/awesome-readme): a list of awesome README files for inspiration. Check the basics [here](https://github.com/PurpleBooth/a-good-readme-template).\n\n## Credits\n\nThis repository is based on a heavily modified fork of [pytorch-template](https://github.com/victoresque/pytorch-template) and [asr_project_template](https://github.com/WrathOfGrapes/asr_project_template) repositories.\n\n## License\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblinorot%2Fpytorch_project_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblinorot%2Fpytorch_project_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblinorot%2Fpytorch_project_template/lists"}