Pytorch project template and related tools
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytorch_lantern-0.12.14.tar.gz.
File metadata
- Download URL: pytorch_lantern-0.12.14.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.8.18 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b97f3f40779afc0a83bbb21a26b3d645f261dbbfc3f55bfcbed58867ef030657
|
|
| MD5 |
6a1af6c80811c15fa38d5a7858ac94e5
|
|
| BLAKE2b-256 |
54a48ba0eed2f4835d30bb8dbf6b1c8c14e45f0aaf1d0fb92be5851f7c3eb2f9
|
File details
Details for the file pytorch_lantern-0.12.14-py3-none-any.whl.
File metadata
- Download URL: pytorch_lantern-0.12.14-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.8.18 Linux/6.8.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da3711e487e6c67063501deb78863ae1ec1a9b3bc1bcf52ed8cffa4099783324
|
|
| MD5 |
ebacc4c9898eda6efccb01d5c065d6f3
|
|
| BLAKE2b-256 |
67e1e37ede6ef18b105211e8e2cdaa4bb6c73e45b5e5295f70fc3099853d26ea
|