{"id":21010504,"url":"https://github.com/hughplay/deepcodebase","last_synced_at":"2025-09-03T05:44:32.631Z","repository":{"id":48140304,"uuid":"509777607","full_name":"hughplay/DeepCodebase","owner":"hughplay","description":":building_construction: A template for deep learning projects.","archived":false,"fork":false,"pushed_at":"2024-09-13T11:26:30.000Z","size":382,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-14T01:10:34.842Z","etag":null,"topics":["codebase","deep-learning","docker","hydra","mnist","pytorch","pytorch-lightning","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/hughplay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-07-02T14:29:41.000Z","updated_at":"2024-09-13T11:26:34.000Z","dependencies_parsed_at":"2023-12-22T10:25:14.657Z","dependency_job_id":"7921e807-5a45-47a0-b9ab-96efcacd4681","html_url":"https://github.com/hughplay/DeepCodebase","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2FDeepCodebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2FDeepCodebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2FDeepCodebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughplay%2FDeepCodebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hughplay","download_url":"https://codeload.github.com/hughplay/DeepCodebase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324944,"owners_count":17456630,"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":["codebase","deep-learning","docker","hydra","mnist","pytorch","pytorch-lightning","template"],"created_at":"2024-11-19T09:20:59.116Z","updated_at":"2024-11-19T09:20:59.857Z","avatar_url":"https://github.com/hughplay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align = center\u003e\n\n\u003cbr\u003e\n\n\u003cimg src = \"docs/_static/imgs/logo.svg\" width=\"80%\"\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003c!-- [![DeepCodebase](docs/_static/imgs/logo.svg)](https://github.com/hughplay/DeepCodebase) --\u003e\n\n\u003c!-- https://ileriayo.github.io/markdown-badges/ --\u003e\n![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=flat-square\u0026logo=docker\u0026logoColor=white)\n![Anaconda](https://img.shields.io/badge/Anaconda-%2344A833.svg?style=flat-square\u0026logo=anaconda\u0026logoColor=white)\n[![](https://img.shields.io/badge/PyTorch-ee4c2c?style=flat-square\u0026logo=pytorch\u0026logoColor=white)](https://pytorch.org/get-started/locally/)\n[![](https://img.shields.io/badge/-Lightning-792ee5?style=flat-square\u0026logo=pytorchlightning\u0026logoColor=white)](https://pytorchlightning.ai/)\n[![](docs/_static/imgs/hydra.svg)](https://hydra.cc)\n![](https://img.shields.io/badge/Weights_\u0026_Biases-FFCC33?style=flat-square\u0026logo=WeightsAndBiases\u0026logoColor=black)\n[![](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square\u0026labelColor=gray)](#license)\n\n*A template for deep learning projects.*\n\n[[Use this template]](https://github.com/hughplay/DeepCodebase/generate) [[Document]](https://hongxin2019.github.io/deepcodebase/)\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n## Pre-requirements\n\n- [Docker](https://docs.docker.com/engine/install)\n- [Nvidia-Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker)\n- [docker-compose](https://docs.docker.com/compose/install/)\n\n\u003c!-- \u003cbr\u003e --\u003e\n\n\n## Quick Start\n\n\nTLDR; We have prepare the commands in the `Makefile` for you:\n\n```bash\nmake init                           # run in host, build a docker image for api server and launch the container\nmake in                             # run in host, ctrl + d to exit the container\n\n# experiment\nmake wandb_login                    # run in container, login to wandb\nmake train                          # run in container, train the model\nmake table                          # run in container, generate the latex table\n\n# commit\nmake copy_git                       # run in host, copy git config to the container home\nmake precommit_install              # run in container, prepare pre-commit for tidy code\ngit add . \u0026\u0026 git commit -m \"xxx\"    # run in container, commit code, it will run pre-commit check\n\n# profiling\npython train.py experiment=mnist_lenet debug=profiler  # run in container, using pytorch profiler to profile the code\nmake nsightrun cmd=\"python train.py experiment=mnist_lenet debug=nsight\"  # run in container, launch a nsight system profiler\n```\n\nBelow is the detailed instructions.\n\n**1. Create new project from template**\n\nClick [[Use this template]](https://github.com/hughplay/DeepCodebase/generate) to create a new project from this template.\n\n**2. Clone the new project to local**\n\nYou can find the repository url in the new project page.\n\n```bash\ngit clone \u003crepo url\u003e\n```\n\n**3. Prepare docker environment**\n\n\nBuild the docker image and launch the container with:\n\n```bash\npython docker.py startd --build\n```\n\n**4. Enter the docker container**\n\nEnter the container with:\n\n```bash\npython docker.py\n```\n\nThe docker container is our development environment.\n\n**5. Train a model**\n\nLaunch training with:\n\n```bash\npython train.py experiment=mnist_lenet\n```\n\nor launch multiple training at once:\n\n```bash\npython batchrun.py scripts/train/train_baselines.sh --quotas 1\n```\n\n**6. View results on wandb**\n\nThe training results will be automatically uploaded to wandb. You can view the results on [wandb.ai](https://wandb.ai).\n\n**7. Generate Latex table**\n\nAfter training multiple models, you can generate a latex table with:\n\n```bash\npython scripts/gen_latex_table.py --table baseline\n```\n\nThis will generate a table like this:\n\n```latex\n\\usepackage{booktabs}\n\n\\begin{table}[t]\n\\centering\n\\small\n\\caption{Performance on the MNIST dataset. }\n\\label{tab:baseline}\n\\begin{tabular}{lr}\n\\toprule\nModel \u0026 Accuracy \\\\\n\\midrule\nDNN \u0026 0.974566 \\\\\nLeNet \u0026 \\textbf{0.983000} \\\\\n\\bottomrule\n\\end{tabular}\n\\end{table}\n```\n\n**8. Custom your own project**\n\nModify the code to fit your own deep learning project. Check our [document](https://hongxin19.github.io/deepcodebase/) for more details.\n\n\n**9. Commit you modifications**\n\nWe strongly recommend you to use [pre-commit](https://pre-commit.com/) to check your code before commiting. Before you first commit, you need to install the pre-commit hook with:\n\n```bash\npre-commit install\n```\n\nThen, you can commit your modifications with normal git commands.\n\n```bash\ngit add .\ngit commit -m \"commit message\"\n```\n\nIt will show you the errors if your code does not pass the pre-commit checks. After you fix the errors, you need to git add the modified files and commit again.\n\n\n## Cite us\n\nGive a star and cite us if you find this project useful.\n\n[![DeepCodebase](https://img.shields.io/badge/Deep-Codebase-2d50a5.svg?style=flat-square)](https://github.com/hughplay/DeepCodebase)\n\n```md\n[![DeepCodebase](https://img.shields.io/badge/Deep-Codebase-2d50a5.svg?style=flat-square)](https://github.com/hughplay/DeepCodebase)\n```\n\n*This is a project based on [DeepCodebase](https://github.com/hughplay/DeepCodebase) template.*\n\n``` md\n*This is a project based on [DeepCodebase](https://github.com/hughplay/DeepCodebase) template.*\n```\n\n## Projects based on DeepCodebase\n\n- [TVR](https://github.com/hughplay/TVR)\n\n## License\n\nDeepCodebase is released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughplay%2Fdeepcodebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhughplay%2Fdeepcodebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughplay%2Fdeepcodebase/lists"}