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.1.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.1-py3-none-any.whl (227.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: canvas_template-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 82bbe50ede0757592af567fa8c841c25185c68303cad2eb902a5c995507525cd
MD5 5db1bc2e5b866502a2ac2c125989ffa5
BLAKE2b-256 efcb42dd427e03ca82fbe3446ee24e2cbe1bafc73e81a25669456b5f55a2c5df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for canvas_template-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb40d271d3ea51e1b1b31dfc4754743c6ae1adf1ae5f0622ed54374261153838
MD5 0d19a721d15e1c740c7d4146231f52b7
BLAKE2b-256 d17add2ef0273dda4366164d4d221fc979178026e614f78cd81781488414d475

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