当前位置:网站首页>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
边栏推荐
- 2022r2 mobile pressure vessel filling test question simulation test platform operation
- Multithread decompression of tar
- 20220607. 人脸识别
- Conda创建虚拟环境报错,问题解决
- VS2019 MFC IP Address Control 控件继承CIPAddressCtrl类重绘
- Connect to the database but cannot modify the data
- Search and rescue strategy of underwater robot (FISH)
- Rich dad, poor dad Abstract
- Leverage contextual information
- Scoring prediction problem
猜你喜欢
![[tutorial] deployment process of yolov5 based on tensorflow Lite](/img/d0/c38f27ad76b62b27cdeb68728e9c8c.jpg)
[tutorial] deployment process of yolov5 based on tensorflow Lite

二、八、十、十六进制相互转换

Voice assistant - Measurement Indicators

Topic 1 Single_ Cell_ analysis(1)

L'effet de l'oie sauvage sur l'économie numérique verte de Guilin

謀新局、促發展,桂林綠色數字經濟的頭雁效應

Topic 1 Single_ Cell_ analysis(2)

Topic 1 Single_Cell_analysis(2)

Fcpx plug-in: simple line outgoing text title introduction animation call outs with photo placeholders for fcpx

2、 Eight, ten and hexadecimal conversion
随机推荐
2021.11.3-7 scientific research log
Topic 1 Single_Cell_analysis(2)
FPGA based communication system receiver [packet detection] development document
The R language uses the sample The split function divides the machine learning data set into training set and test set
Voice assistant -- Architecture and design of Instruction Assistant
Topic 1 Single_Cell_analysis(3)
2D visualization of oil storage, transportation and production, configuration application enables intelligent development of industry
VS 2019 MFC 通过ACE引擎连接并访问Access数据库类库封装
Cold start problem of recommended system
Leverage contextual information
20220607. 人脸识别
Classic paper review: palette based photo retrieval
Work summary of the week from November 22 to 28, 2021
Topic 1 Single_Cell_analysis(4)
Vscode 1.68 changes and concerns (sorting and importing statements / experimental new command center, etc.)
Scoring prediction problem
Compiling principle on computer -- functional drawing language (V): compiler and interpreter
R语言glm函数构建泊松回归模型(possion)、epiDisplay包的poisgof函数对拟合的泊松回归模型进行拟合优度检验、即模型拟合的效果、验证模型是否有过度离散overdispersion
Voice assistant - those classification models used in the assistant
Unity uses shaders to highlight the edges of ugu I pictures