当前位置:网站首页>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
边栏推荐
- The project file contains toolsversion= "14.0". This toolset may be unknown or missing workarounds
- Numerical calculation method chapter5 Direct method for solving linear equations
- Vs2019 MFC IP address control control inherits cipaddressctrl class redrawing
- Process terminated
- Compiling principle on computer -- functional drawing language (IV): semantic analyzer
- Topic 1 Single_Cell_analysis(3)
- Chapter 3 - Fundamentals of cryptography
- Chapter 6 - identity authentication, Chapter 7 - access control
- Topic 1 Single_Cell_analysis(4)
- Topic 1 Single_ Cell_ analysis(3)
猜你喜欢
![‘CMRESHandler‘ object has no attribute ‘_ timer‘,socket. gaierror: [Errno 8] nodename nor servname pro](/img/de/6756c1b8d9b792118bebb2d6c1e54c.png)
‘CMRESHandler‘ object has no attribute ‘_ timer‘,socket. gaierror: [Errno 8] nodename nor servname pro

『Three.js』辅助坐标轴

Classic paper review: palette based photo retrieval

Unity uses shaders to highlight the edges of ugu I pictures

Topic 1 Single_Cell_analysis(3)

Symfony 2: multiple and dynamic database connections

Utilize user behavior data

What is a good recommendation system?

Voice assistant - Introduction and interaction process

Chapter 2 - cyber threats and attacks
随机推荐
Voice assistant - Introduction and interaction process
Compiling principle on computer -- functional drawing language (V): compiler and interpreter
R语言使用RStudio将可视化结果保存为pdf文件(export--Save as PDF)
Chapter 4 - key management and distribution
What is a good recommendation system?
Preliminary knowledge next New concepts such as isr/rsc/edge runtime/streaming in JS
Voice assistant - future trends
[redistemplate method details]
20220526 yolov1-v5
Vs2019 MFC IP address Control Control inherit cipaddressctrl class redessine
LeetCode笔记:Biweekly Contest 79
Latex usage problems and skills summary (under update)
[tutorial] deployment process of yolov5 based on tensorflow Lite
Topic 1 Single_ Cell_ analysis(3)
20220525 RCNN--->Faster RCNN
Voice assistant -- Architecture and design of Instruction Assistant
R language uses the sum function of epidisplay package to calculate the descriptive statistical summary information of the specified variables in dataframe under different grouping variables, visualiz
Meter Reading Instrument(MRI) Remote Terminal Unit electric gas water
AI fanaticism | come to this conference and work together on the new tools of AI!
Voice assistant - those classification models used in the assistant