当前位置:网站首页>How to standardize the creation of a pytorch project
How to standardize the creation of a pytorch project
2022-06-12 07:53:00 【Wait for Godot.】
A good Pytorch The project shall include the following specifications :
Definition PyTorch Software engineering specification of the project , contain :
- Code directory for training tests / Document specification ;
- Configuration specification ;
Code directory for training tests / Document specification
Fit every deepvac canonical PyTorch Model training program , Include the following directories and files :
| Catalog / file | explain | Whether must |
|---|---|---|
| README.md | Project description 、git Number of branches and their introduction 、 Description of the storage path of the original data | yes |
| train.py | Model training and validation documentation , Inherit DeepvacTrain Class extension implementation | yes |
| test.py | Model test file , Inherit Deepvac Class extension implementation | yes |
| config.py | Project overall configuration file | yes |
| modules/model.py | Model definition file ,PyTorch Module Class extension implementation | In the case of a single model , yes |
| modules/model_{name}.py | ditto , There are many. model When , Use suffix distinguish | In the case of multiple models , yes |
| modules/loss.py | loss Realization . If the implementation is lightweight , It can be placed directly in modules/model.py in | no |
| modules/utils.py | Tool class / Method definition file | no |
| modules/utils_{name}.py | ditto , There are multiple tool classes / Function file , Use suffix distinguish | no |
| synthesis/synthesis.py | Data synthesis or cleaning code | no |
| synthesis/config.py | synthesis.py Configuration file for | no |
| data/dataloader.py | dataset Class | no |
| data/train.txt | Training set manifest file | no |
| data/val.txt | Validation set manifest file | no |
| aug/aug.py | Data enhanced code . If the implementation is lightweight , It can be placed directly in dataset Class | no |
| aug/config.py | aug.py Configuration file for | no |
| log/*.log | Log output directory | yes |
| output/model__*.pth | Export or import model file | Default Deepvac Output |
| output/checkpoint__*.pth | Output or input checkpoint file | Default Deepvac Output |
These files cover a PyTorch The whole life cycle of model training :
- Raw data , stay README.md Description in ;
- Data cleaning / synthesis , stay synthesis/synthesis.py In the definition of ;
- Data to enhance , stay aug/aug.py In the definition of ( Light weight can be achieved in dataset Definition in class );
- data input , stay data/dataloader.py In the definition of ;
- model training , stay train.py In the definition of ;
- Model validation , stay train.py In the definition of ;
- Model test , stay test.py In the definition of ;
- Model output , stay output To store in a directory ;
- Log output , stay log To store in a directory ;
Configuration specification
- config.py Is a first-class citizen in the norms ;
- The configuration of user interface level is in config.py in ;
- The configurations defined by internal development are all in the class auditConfig In the method , And can be config.py The values in override ;
- When starting distributed training , because –rank and –gpu The parameter is process level , from argparse.ArgumentParser Module to pass , The user needs to specify... On the command line ;
- The input parameters of the constructor of a class are generally config example ;
- Again ,config.py Be a first-class citizen in the norm .
Excerpt from :DeepVac
边栏推荐
- R language uses neuralnet package to build neural network regression model (feedforward neural network regression model) and calculate MSE value (mean square error) of the model on the test set
- Work summary of the week from November 22 to 28, 2021
- 20220526 yolov1-v5
- Right click the general solution of file rotation jam, refresh, white screen, flash back and desktop crash
- Chapter 4 - key management and distribution
- Voice assistant - Qu - single entity recall
- The R language catools package divides the data, the scale function scales the data, the KNN function of the class package constructs a k-nearest neighbor classifier, and compares the model accuracy u
- R语言将dataframe数据中指定数据列的数据从小数转化为百分比表示、数据转换为百分数
- 最新hbuilderX编辑uni-app项目运行于夜神模拟器
- 2021.10.24-25 scientific research log
猜你喜欢

Summary of semantic segmentation learning (II) -- UNET network

Search and rescue strategy of underwater robot (FISH)

Improvement of hash function based on life game (continued 2)

BI技巧丨当月期初

20220526 yolov1-v5

Meter Reading Instrument(MRI) Remote Terminal Unit electric gas water

Voice assistant - Multi round conversation (process implementation)

经典论文回顾:Palette-based Photo Recoloring

Logistic regression

L'effet de l'oie sauvage sur l'économie numérique verte de Guilin
随机推荐
R语言rnorm函数生成正太分布数据、使用epiDisplay包的summ函数计算向量数据的描述性统计汇总信息并可视化有序点图(名称、有效值个数、均值、中位数、标准差、最大值、最小值)
R语言使用RStudio将可视化结果保存为pdf文件(export--Save as PDF)
石油储运生产 2D 可视化,组态应用赋能工业智慧发展
Improvement of hash function based on life game (continued 1)
20220526 loss function
Compiling principle on computer -- functional drawing language (IV): semantic analyzer
FPGA based communication system receiver [packet detection] development document
Search and rescue strategy of underwater robot (FISH)
Xshell installation
Cold start problem of recommended system
Leetcode notes: Weekly contest 295
The R language converts the data of the specified data column in the dataframe data from decimal to percentage representation, and the data to percentage
[tutorial] deployment process of yolov5 based on tensorflow Lite
Arrangement of statistical learning knowledge points gradient descent, least square method, Newton method
WEB页面性能优化面试题
Topic 1 Single_Cell_analysis(3)
Rich dad, poor dad Abstract
ECMAScript6面试题
20220526 yolov1-v5
20220524 深度学习技术点