Skip to main content

A modular, best-practice pytorch template for all your deep learning projects.

Project description

Canvas ☯︎

"Beauty is as important in computing as it is in painting or architecture." — Donald E. Knuth

A simple, flexible, and modular PyTorch template for kickstarting your deep learning projects. Inspired by the agent-environment interface, Canvas aims to provide a unified template for all types of ML projects.

Canvas Architecture

Available Templates

Canvas offers unique templates to kickstart various machine learning tasks:

  • Supervised Learning (SL): Perfect for tasks like classification and regression, where you have labeled data.

  • Reinforcement Learning (RL): Designed for building agents that learn by interacting with an environment.

  • Self-Supervised Learning (SSL): Train models to learn representations from unlabeled data.

Installation

Canvas requires Python 3.11+. Since it's a command-line tool, we highly recommend using uv for installation.

# Recommended: with uv
uv tool install canvas-template

# Alternative: with pip
pip install canvas-template

Usage

To create a new project, run the canvas init command and pick your template. No need to create a directory first; Canvas will do it for you.

canvas init [sl|ssl|rl]

Example: The following settings will create a project named my_project with the self-supervised learning (SSL) template.

Canvas Demo

Project Structure

The directory structure of your new project will look something like this (depending on the settings that you choose):

example-project/
├── Makefile                # Convenient make commands
├── LICENSE                 # Project license
├── README.md               # Your project's main README file
├── mkdocs.yml              # Configuration for building documentation
├── pyproject.toml          # Project metadata and dependencies
├── uv.lock                 # uv lock file for consistent environments
├── docs/                   # Where your project's documentation lives
│   └── index.md
├── src/                    # All the source code for your deep learning project
│   ├── main.py             # The main entry point of your project
│   ├── config/             # Hydra configuration files for managing settings
│   │   └── config.yaml
│   ├── model/              # Your deep learning model definitions
│   │   ├── __init__.py
│   │   ├── model.py
│   │   ├── network.py
│   │   └── loss.py
│   ├── data/               # Scripts for loading and preparing your data
│   │   ├── __init__.py
│   │   ├── data.py
│   │   └── preprocess.py
│   └── algorithm/          # The core algorithm: training, evaluation
│       ├── __init__.py
│       ├── trainer.py
│       └── evaluator.py
├── dataset/                # Place your raw or processed datasets here
│   └── ...
└── outputs/                # Where experiment logs, model checkpoints, and results are saved
    └── ...

Contributing

Any kind of enhancement or contribution is welcome. If you have bug fixes, new features, or any improvements, I'd love your help!

TODOs

  • Experiment Tracking (wandb, tensorboard)
  • Testing Framework (pytest, unittest)
  • Distributed Training (pytorch, accelerate)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canvas_template-0.3.0.tar.gz (844.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canvas_template-0.3.0-py3-none-any.whl (227.5 kB view details)

Uploaded Python 3

File details

Details for the file canvas_template-0.3.0.tar.gz.

File metadata

  • Download URL: canvas_template-0.3.0.tar.gz
  • Upload date:
  • Size: 844.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for canvas_template-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c9f636fcda129404038cb5f5b2f2afcc49a98ac16bf7d8597d0e3507321922d6
MD5 48a38ce38afda0562e08ef03ca13300b
BLAKE2b-256 af1ca207dfd5e3674e84bfa10413c419047ddf9dbbb7469b26bc41e56bf98ad9

See more details on using hashes here.

File details

Details for the file canvas_template-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for canvas_template-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 911b48ec59803874ddec68aedf8e8f46b045620d27d9799db97437ad6ec32afe
MD5 08c13d8f9e2f6b810dae53071809f84a
BLAKE2b-256 fc338c171a75e0d23929b6132b41e98f7b259354a060e94242d8be4378cc41b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page