Skip to main content
https://codecov.io/gh/kijanac/luz/branch/main/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

Lightweight framework for structuring arbitrary reproducible neural network learning procedures using PyTorch.

PyTorch code can easily become complex, unwieldy, and difficult to understand as a project develops. Luz aims to provide a common scaffold for PyTorch code in order to minimize boilerplate, maximize readability, and maintain the flexibility of PyTorch itself.

The basis of Luz is the Runner, an abstraction representing batch-wise processing of data over multiple epochs. Runner has predefined hooks to which code can be attached and a State which can be manipulated to define essentially arbitrary behavior. These hooks can be used to compose multiple Runners into a single algorithm, enabling dataset preprocessing, model testing, and other common tasks.

To further reduce boilerplate, the Learner abstraction is introduced as shorthand for the extremely common Preprocess-Train-Validate-Test algorithm. Simply inherit luz.Learner and define a handful of methods to completely customize your learning algorithm.

Two additional abstractions are provided for convenience: Scorers, which score (i.e. evaluate) a Learner according to some predefined procedure, and Tuners, which tune Learner hyperparameters. These abstractions provide a common interface which makes model selection a two-line process.

Getting Started

Installing

From pip:

pip install luz

From conda:

conda install -c conda-forge -c pytorch -c kijana luz

Documentation

See documentation here.

Examples

See example scripts in Examples.

Authors

Ki-Jana Carter

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

See CONTRIBUTING.

Release files for luz 10.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luz 10.3.0
File Size Uploaded
luz-10.3.0.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for luz 10.3.0
File Interpreter ABI Platform
luz-10.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.4 kB

Release files / luz-10.3.0.tar.gz

Download URL luz-10.3.0.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fa6685eb6b736187ffd8280c04307d8d38585041b2029f9ee032f56ea48c69f4
BLAKE2b-256 checksum
How to use checksums
7b9dd448b46c07e441af221b4784cfe90c7b8959f1e5b79aa3c3be8e5a10c104
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.7 Linux/5.11.0-43-generic

Release files / luz-10.3.0-py3-none-any.whl

Download URL luz-10.3.0-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4014d7d12dc212fad53c549c57fb67eb7d659645a4a037702305433de39a26b
BLAKE2b-256 checksum
How to use checksums
8636f551278a3c5ae0b82bab7243617be5c06f1beeb7d022787a508b59974bc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.7 Linux/5.11.0-43-generic

Release history Release notifications | RSS feed

This release

10.3.0 This release

2 release files

10.2.3

2 release files

10.2.2

2 release files

10.2.1

2 release files

10.2.0

2 release files

10.1.0

2 release files

10.0.0

2 release files

9.0.0

2 release files

8.0.0

2 release files

6.0.0

2 release files

5.0.0

2 release files

4.0.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page