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]
Metadata
Release files for pytorch-lantern 0.12.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytorch_lantern-0.12.15.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytorch_lantern-0.12.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / pytorch_lantern-0.12.15.tar.gz
| Download URL | pytorch_lantern-0.12.15.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd1db5d79a958664d5d5d46f8da6f4193e98b389db84a33aa60620d519a013b3
|
|
BLAKE2b-256 checksum How to use checksums |
dfc71b56dcfc3ac36fa357decff3d0a082d101408a30e3ee0468be5f3613ae84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / pytorch_lantern-0.12.15-py3-none-any.whl
| Download URL | pytorch_lantern-0.12.15-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbcb05d8ca2e84004ebb3644ca1d6deac53dd3748783acf8af327ed33386cfac
|
|
BLAKE2b-256 checksum How to use checksums |
833c30c305332a164af1d54f5c513bca6f6c1a98011e144cad59ee3f0391a1b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|