Organize Python project using Flat Layout for deep learning
A Flat Layout simplifies project structure and is well-supported by package builders and IDEs like VS Code. The core requirement is that the main package directory must contain an
__init__.py file to be importable after installation. If using a Flat Layout, you must configure the include parameter in pyproject.toml so the package builder knows which directory to use.deeplearning/
├── deeplearning/ # Model code
│ ├── __init__.py # Required for imports
│ ├── net/
│ │ ├── net1.py
│ │ └── net2.py
│ └── data/
│ ├── dataloader.py
│ └── dataset.py
├── script/ # Training scripts
├── test/ # Test code
└── pyproject.toml # Configuration for packaging