{"id":15355613,"url":"https://github.com/songquanpeng/pytorch-template","last_synced_at":"2025-04-05T14:06:52.630Z","repository":{"id":37699992,"uuid":"369068708","full_name":"songquanpeng/pytorch-template","owner":"songquanpeng","description":"To be the world's best PyTorch project template.","archived":false,"fork":false,"pushed_at":"2023-03-25T01:37:50.000Z","size":113,"stargazers_count":503,"open_issues_count":1,"forks_count":73,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T13:07:58.635Z","etag":null,"topics":["boilerplates","gan","gans","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/songquanpeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-20T03:32:34.000Z","updated_at":"2025-03-27T01:39:23.000Z","dependencies_parsed_at":"2024-10-16T03:31:18.764Z","dependency_job_id":null,"html_url":"https://github.com/songquanpeng/pytorch-template","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":"0.30666666666666664","last_synced_commit":"aade16f759e709474f1a3da7924372da3a2a34fc"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songquanpeng%2Fpytorch-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songquanpeng%2Fpytorch-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songquanpeng%2Fpytorch-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songquanpeng%2Fpytorch-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/songquanpeng","download_url":"https://codeload.github.com/songquanpeng/pytorch-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345852,"owners_count":20924102,"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":["boilerplates","gan","gans","pytorch","pytorch-template"],"created_at":"2024-10-01T12:24:58.276Z","updated_at":"2025-04-05T14:06:52.606Z","avatar_url":"https://github.com/songquanpeng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch Template\n\u003e A clear PyTorch template for swift model building.\n\n## Features\n+ [x] Well-organized project template out of the box.\n+ [x] Automatically record the model version (by saving the git commit hash) for later reproduction.\n+ [x] Automatically start TensorBoard for you.\n+ [x] Use JSON file or command line arguments to specify arguments.\n+ [x] The results of each experiment are properly stored.\n\n\n## Steps\n1. Modify the model structures `models/build.py`.\n2. Update the loss functions used `solver/loss.py`.\n3. Update the data loading process `data/dataset.py` \u0026 `data/loader.py`.\n4. Add metrics that can measure your model's performance `metrics/eval.py`.\n5. Update sampling functions \u0026 logging functions, so you can see the results with TensorBoard `solver/solver.py`!\n6. Add a shell script that run your model `scripts/{exp_id}-model_key_config.sh`.\n7. Start training, evaluating or inference by running the above script!\n\n## Structures\n```\n+--- .gitignore\n+--- archive (generated files \u0026 dataset)\n|   +--- README.md\n+--- bin (utility script)\n|   +--- README.md\n|   +--- template.py\n+--- config.py (options)\n+--- data (data fetching related)\n|   +--- dataset.py\n|   +--- fetcher.py\n|   +--- loader.py\n|   +--- README.md\n+--- expr (experiment directory)\n+--- main.py (everything start from here)\n+--- metrics (metric used)\n|   +--- eval.py\n|   +--- fid.py\n|   +--- README.md\n+--- models (model architecture related)\n|   +--- build.py (the wrapper for models)\n|   +--- discriminator.py\n|   +--- generator.py\n|   +--- layers.py\n|   +--- mapping_network.py\n|   +--- README.md\n+--- README.md\n+--- requirements.txt\n+--- scripts (training related shell scripts)\n|   +--- train.sh\n+--- solver (training related)\n|   +--- loss.py\n|   +--- misc.py\n|   +--- solver.py\n|   +--- utils.py\n+--- utils (utility functions)\n|   +--- checkpoint.py\n|   +--- file.py\n|   +--- image.py\n|   +--- logger.py\n|   +--- misc.py\n|   +--- model.py\n```\n\n## Others\nI referred [StarGAN v2's official implementation](https://github.com/clovaai/stargan-v2) when crafting this template, \nso don't be surprised if you find some code is similar.\n\nBTW, if you want to deploy your model, you may want to check out [this template](https://github.com/songquanpeng/pytorch-deployment).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongquanpeng%2Fpytorch-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsongquanpeng%2Fpytorch-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongquanpeng%2Fpytorch-template/lists"}