🌟 We are Open Source! Check out our repository on GitHub

PyTorch Project Structure

A scalable and maintainable folder structure for PyTorch applications

File Structure

  • src
    • train.py
    • model.py
    • dataset.py
    • utils.py
  • data
    • raw
    • processed
  • models
    • checkpoints
  • requirements.txt
  • README.md

Directory Structure Explanation

src/

Contains the main Python source code for the PyTorch project.

src/train.py

Main training script that defines the training loop and model training process.

src/model.py

Defines the neural network architecture using PyTorch modules.

src/dataset.py

Custom PyTorch Dataset class for loading and preprocessing data.

src/utils.py

Utility functions for data processing and helper methods.

data/

Contains datasets organized by processing stage.

models/checkpoints/

Saved model checkpoints during training for recovery and evaluation.