• Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    Python
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

To be the world's best PyTorch project template.

PyTorch Template

A clear PyTorch template for swift model building.

Features

  • Well-organized project template out of the box.
  • Automatically record the model version (by saving the git commit hash) for later reproduction.
  • Automatically start TensorBoard for you.
  • Use JSON file or command line arguments to specify arguments.
  • The results of each experiment are properly stored.

Steps

  1. Modify the model structures models/build.py.
  2. Update the loss functions used solver/loss.py.
  3. Update the data loading process data/dataset.py & data/loader.py.
  4. Add metrics that can measure your model's performance metrics/eval.py.
  5. Update sampling functions & logging functions, so you can see the results with TensorBoard solver/solver.py!
  6. Add a shell script that run your model scripts/{exp_id}-model_key_config.sh.
  7. Start training, evaluating or inference by running the above script!

Structures

+--- .gitignore
+--- archive (generated files & dataset)
|   +--- README.md
+--- bin (utility script)
|   +--- README.md
|   +--- template.py
+--- config.py (options)
+--- data (data fetching related)
|   +--- dataset.py
|   +--- fetcher.py
|   +--- loader.py
|   +--- README.md
+--- expr (experiment directory)
+--- main.py (everything start from here)
+--- metrics (metric used)
|   +--- eval.py
|   +--- fid.py
|   +--- README.md
+--- models (model architecture related)
|   +--- build.py (the wrapper for models)
|   +--- discriminator.py
|   +--- generator.py
|   +--- layers.py
|   +--- mapping_network.py
|   +--- README.md
+--- README.md
+--- requirements.txt
+--- scripts (training related shell scripts)
|   +--- train.sh
+--- solver (training related)
|   +--- loss.py
|   +--- misc.py
|   +--- solver.py
|   +--- utils.py
+--- utils (utility functions)
|   +--- checkpoint.py
|   +--- file.py
|   +--- image.py
|   +--- logger.py
|   +--- misc.py
|   +--- model.py

Others

I referred StarGAN v2's official implementation when crafting this template, so don't be surprised if you find some code is similar.

BTW, if you want to deploy your model, you may want to check out this template.

More Repositories

1

one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
JavaScript
18,247
star
2

message-pusher

搭建专属于你的消息推送服务,支持多种消息推送方式,支持 Markdown,基于 Golang 仅单可执行文件,开箱即用
JavaScript
1,045
star
3

go-file

基于 Go 的文件分享工具,仅单可执行文件,开箱即用,内置图床和视频播放页面. File sharing tool based on Go.
HTML
527
star
4

stats-cards

在 README 中展示你在知乎,GitHub,B 站,LeetCode,掘金,CSDN,牛客等网站的数据,也可用于服务状态监控. Show your LeetCode & GitHub stats in GitHub Profile.
JavaScript
161
star
5

pronunciation-corrector

拯救你的英语发音,告别因发音错误带来的尴尬!
JavaScript
120
star
6

blog

基于 Node.js 的个人博客系统. Node.js based blog system.
JavaScript
46
star
7

go-public

基于 Go 的端口转发工具,开箱即用. Yet another port forward tool, but easy to use.
Go
29
star
8

battle-city

基于 TypeScript 的《坦克大战》的非标准实现. Yet another Battle City implementation with TypeScript.
TypeScript
23
star
9

microblog

基于 Go 的个人微博客,一个供你闲言碎语的地方. Go based microblog system.
Go
21
star
10

wechat-server

微信公众号的后端,为其他系统提供微信登录验证功能
Go
19
star
11

zhihu-archiver

每日自动抓取知乎热榜,之后转换成 Markdown 文件并构造静态网站
Python
18
star
12

pytorch-deployment

A template for rapid deployment of PyTorch models.
Python
18
star
13

v2ex-clone

V2EX 风格的论坛程序. V2EX's Node.js clone.
JavaScript
16
star
14

L2M-GAN

Unofficial PyTorch implementation of "L2M-GAN: Learning To Manipulate Latent Space Semantics for Facial Attribute Editing".
Python
16
star
15

chat-room

基于 Node.js 开发的聊天室应用. Chat room powered by Node.js.
JavaScript
15
star
16

personal-assistant

让生活简单一点的个人助理应用. A personal assistant app that makes your life easier.
Python
14
star
17

lan-share

基于 Node.js 的文件分享工具. File sharing tool based on Node.js.
HTML
14
star
18

online-code-editor

基于 Node.js & Express.js 的在线代码编辑器. Online code editor based on Node.js.
JavaScript
11
star
19

js-interpreter

一个简陋的 JavaScript 解释器实现. A simple JavaScript interpreter, build for beginners.
C++
11
star
20

related-repos

Find related repository by stars.
JavaScript
10
star
21

gofile-launcher

为 Go File 制作的启动器. Launcher for Go File.
Python
10
star
22

report-generator

用于生成华南理工大学计算机专业校内实习日志,Release 里有打包好的二进制文件,开箱即用!
Python
10
star
23

cv-interview

计算机视觉算法岗面试准备:常考算法的实现
Python
9
star
24

go-text

基于 Go 的终端风格在线聊天工具,仅单可执行文件,开箱即用. Go based terminal-style chat room.
Go
9
star
25

webhook

Execute predefined commands on your server when receiving a specific HTTP GET request.
Go
9
star
26

hexo-theme-lightx

Hexo theme lightx.
HTML
9
star
27

gin-template

用于 Gin & React 项目的模板. Template for Gin & React projects.
JavaScript
9
star
28

songquanpeng

Automatically update your GitHub profile with GitHub Actions.
Python
6
star
29

text-formatter

功能丰富的在线文本清理工具,可用于 PDF、PPT、CAJ 等文字复制格式化,去除多余的空格与换行
HTML
6
star
30

chip8-emulator

Yet another online Chip-8 emulator.
JavaScript
5
star
31

daily-submit

华南理工大学每日自动报平安,自动健康填报
Python
4
star
32

pyqt-template

我的 PyQt 项目模板. My PyQt template.
Python
4
star
33

font-sr

基于 GAN 的字体图片超分辨. Super resoluation for font images based on GANs.
Python
3
star
34

web-reminder

帮你控制摸鱼时间的小工具~
JavaScript
3
star
35

chat-room-android

An android chat room application.
Java
3
star
36

BlendGAN

[WIP] Unofficial PyTorch implementation of "BlendGAN: Implicitly GAN Blending for Arbitrary Stylized Face Generation".
Python
2
star
37

handwriting-generator

手写中文文章生成,可用于生成各种需要手写的文件
Python
2
star
38

terminal-emulator

An online terminal emulator.
JavaScript
2
star
39

filesystem-emulator

Linux filesystem emulator.
C++
2
star
40

openai-mocker

一个模拟 OpenAI API 的 mock server,用以 One API 的压测
Go
2
star
41

rest-reminder

A reminder that will notify you when you need a rest.
C++
2
star
42

go-relay

基于 Go 的 HTTP 中继工具,为你的服务器请求 OpenAI 的 API 提供中继服务,也可用于搭建镜像站,开箱即用. Golang based HTTP relay server.
Go
2
star
43

blog-theme-v2ex

Theme for the following blog system: https://github.com/songquanpeng/blog
EJS
2
star
44

scut-wiki

华南理工大学非官方 Wiki
2
star
45

scripts

在终端执行的脚本,浏览器脚本所在的仓库:https://github.com/songquanpeng/userscripts
Python
1
star
46

mail-query

Quick eml file query.
Python
1
star
47

command-faker

An executable file generator that used to fake other programs.
C
1
star
48

bulma-template

Template for Bulma.
HTML
1
star
49

socks5

Yep, another Socks5 proxy server implementation.
Go
1
star
50

md2html

A markdown parser without regex used.
Go
1
star
51

snippet-manager

[WIP] Your self-deployed online code snippet manager.
JavaScript
1
star
52

pdf2excel

将 PDF 文件转化为 Excel 表格. Convert your PDF files to Excel files.
Python
1
star
53

minecraft-2d

A 2D game based on Qt.
C++
1
star
54

gofile-cli

[WIP] CLI for Go File.
Go
1
star
55

hero-calculator

王者荣耀英雄属性计算器
Java
1
star
56

XploreGAN

Unofficial PyTorch Implementation for "Exploring Unlabeled Faces for Novel Attribute Discovery"
Python
1
star
57

crack-captcha

Crack captcha of http://dyxt.jw.scut.edu.cn/
Python
1
star
58

pytorch-classifiers

PyTorch implementation of classic classifiers networks.
Python
1
star
59

ViTGAN

[WIP] Unofficial PyTorch implementation for "ViTGAN: Training GANs with Vision Transformers".
Python
1
star