Skip to main content

pixtreme.train.common

The pure Python distribution pixtreme-train provides the import package pixtreme.train.common: training components that do not depend on a particular model, shared by the pixtreme trainer modules.

The wheel owns only the pixtreme/train/common/ subtree. The namespace root pixtreme/__init__.py is owned by pixtreme, and each trainer module owns its own pixtreme/train/<module>/ subtree.

Installation

Use Linux x86_64 with CPython 3.12 or later. Install the distribution from PyPI:

pip install pixtreme-train

For a project managed with uv:

uv add pixtreme-train

PSNR and SSIM measurement needs an NVIDIA GPU with CUDA 13, as required by pixtreme. The other components also run without a GPU. The prores_lt, h264 and hevc encode steps, and reading 16-bit RGB images, need an ffmpeg command on PATH with the prores_ks, libx264 and libx265 encoders.

Training from a configuration

A trainer module registers its networks, losses and training steps by name, and a YAML configuration combines them:

import torch

from pixtreme.train.common import register


@register("network", "tiny")
class Tiny(torch.nn.Module):
    def __init__(self, *, channels: int = 3) -> None:
        super().__init__()
        self.body = torch.nn.Conv2d(channels, channels, 3, padding=1)

    def forward(self, image: torch.Tensor) -> torch.Tensor:
        return image + self.body(image)
imports: [my_trainer]
networks:
  main: {type: tiny}
losses:
  pixel: {type: l1}
optimizers:
  main: {type: adamw, networks: [main], lr: 2.0e-4}
data:
  train: {type: image_degradation, directory: /data/train, region_size: 64, patch_size: 64, batch_size: 8}
degradation: {name: identity, seed: 0, steps: []}
train: {iterations: 1000, seed: 0, device: cuda, checkpoint_interval: 500}
pixtreme-train train config.yaml --output runs/first

The command writes the resolved configuration, one JSON line per update and the checkpoints under the output directory, and prints the path of the last checkpoint. pixtreme.train.common.load_network rebuilds a trained network from a checkpoint for inference or export.

License

MIT. See LICENSE.

Metadata

Release files for pixtreme-train 0.3.0

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

Built distribution (wheel)

Table of built distributions (wheels) for pixtreme-train 0.3.0
File Interpreter ABI Platform Actions
pixtreme_train-0.3.0-py3-none-any.whl Python 3 none any Details for pixtreme_train-0.3.0-py3-none-any.whl

Release files / pixtreme_train-0.3.0-py3-none-any.whl

Download URL pixtreme_train-0.3.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cd3d0349892a450bf152b9782d86186238b366d65456aeaca16cdf2ff073b31
BLAKE2b-256 checksum
How to use checksums
9204df7d4f41043128088e466be8fc2e763957423ed836838ce410ca60054463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Security for pixtreme-train 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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