Skip to main content

Pytorch project template and related tools

Project description

https://badge.fury.io/py/pytorch-lantern.svg https://img.shields.io/pypi/pyversions/pytorch-lantern.svg https://readthedocs.org/projects/pytorch-lantern/badge/?version=latest https://img.shields.io/pypi/l/pytorch-lantern.svg https://img.shields.io/badge/code%20style-black-000000.svg

Lantern contains our process of bringing a project to fruition as efficiently as possible. This is subject to change as we iterate and improve. This package implements tools and missing features to help bridge the gap between frameworks and libraries that we utilize.

The main packages and tools that we build around are:

Usage

Example of tensor type hinting.

from pydantic import BaseModel
from typing import Annotated
import torch
from lantern import Tensor

class Example(BaseModel):
    image: Annotated[torch.Tensor, Tensor.dims("NCHW").float()]
    label: Annotated[torch.Tensor, Tensor.dims("N").long()]

example = Example(
    image=torch.rand(32, 3, 224, 224),  # 32 images, 3 channels, 224x224 pixels
    label=torch.randint(0, 10, (32,))   # 32 labels
)

See the documentation for more information and usage examples.

Create new project with template

Install cookiecutter and poetry:

pip install cookiecutter
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Setup project:

cookiecutter https://github.com/nextml-code/pytorch-lantern-template.git
cd <new-project>
poetry install

You can now train the placeholder model and inspect the results:

guild run prepare
guild run train
guild tensorboard

Use lantern without templates

Install lantern from pypi using pip or poetry:

poetry add pytorch-lantern[training]
pip install pytorch-lantern[training]

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

pytorch_lantern-0.12.15.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

pytorch_lantern-0.12.15-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file pytorch_lantern-0.12.15.tar.gz.

File metadata

  • Download URL: pytorch_lantern-0.12.15.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytorch_lantern-0.12.15.tar.gz
Algorithm Hash digest
SHA256 fd1db5d79a958664d5d5d46f8da6f4193e98b389db84a33aa60620d519a013b3
MD5 369982c1e30b51c53a19312dee500cc3
BLAKE2b-256 dfc71b56dcfc3ac36fa357decff3d0a082d101408a30e3ee0468be5f3613ae84

See more details on using hashes here.

File details

Details for the file pytorch_lantern-0.12.15-py3-none-any.whl.

File metadata

  • Download URL: pytorch_lantern-0.12.15-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytorch_lantern-0.12.15-py3-none-any.whl
Algorithm Hash digest
SHA256 dbcb05d8ca2e84004ebb3644ca1d6deac53dd3748783acf8af327ed33386cfac
MD5 e15c967e9c7adc4e4efdb5c813086364
BLAKE2b-256 833c30c305332a164af1d54f5c513bca6f6c1a98011e144cad59ee3f0391a1b7

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