Skip to main content

A Typer CLI application for tuning Lightning modules with Optuna.

Project description

optuna-lightning-cli

CI Docs Publish PyPI Python Docs site

A small Typer CLI for tuning lightning.pytorch modules with Optuna.

Install the MNIST example extra and run the sample HPO flow:

pip install -e ".[examples]"

optuna-lightning tune \
  --training-config examples/mnist-training.yaml \
  --optuna-config examples/mnist-optuna.yaml

MnistClassifier owns the training loop (training_step, validation_step, and configure_optimizers). MnistDataModule owns the MNIST download and data loaders. The CLI validates the config pair, patches Optuna samples into the flat training config, and hands everything to Trainer.fit().

print-config renders the normalized Lightning config under a Lightning Base Config header and the Optuna config under an Optuna Config header.

The CLI also includes config printing, validation, and persisted study inspection:

optuna-lightning print-config \
  --training-config examples/mnist-training.yaml \
  --optuna-config examples/mnist-optuna.yaml

optuna-lightning validate \
  --training-config examples/mnist-training.yaml \
  --optuna-config examples/mnist-optuna.yaml

optuna-lightning studies list --storage sqlite:///optuna.db
optuna-lightning studies show \
  --storage sqlite:///optuna.db \
  --study-name mnist
optuna-lightning studies trials \
  --optuna-config examples/mnist-optuna.yaml

The example Optuna config stores studies in ./optuna.db relative to the directory where the command is run, so studies trials --optuna-config examples/mnist-optuna.yaml can inspect persisted trials later. The trials table labels the value column as Objective [val_acc, maximize] for the MNIST example, and storage-only inspection still shows the study direction in the column header.

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

optuna_lightning_cli-0.1.0.tar.gz (172.8 kB view details)

Uploaded Source

Built Distribution

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

optuna_lightning_cli-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file optuna_lightning_cli-0.1.0.tar.gz.

File metadata

  • Download URL: optuna_lightning_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 172.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for optuna_lightning_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 49eafbae93cacbd89b93b533d93e549e1cf3214bf2f8432b6f50082c05979151
MD5 bbb5abdce576c9a44066566c2bf7866f
BLAKE2b-256 5c770765210ad68004485a83c40bda5984c4b8c1214863cb78badfdd39290a76

See more details on using hashes here.

Provenance

The following attestation bundles were made for optuna_lightning_cli-0.1.0.tar.gz:

Publisher: publish.yml on LukeCPadmore/optuna-lightning-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file optuna_lightning_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for optuna_lightning_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5022292eb9bd6f9920055481b17a68c227c0465401c077e753c4d469e3581e0a
MD5 57fd0df41b859cdb746e0670d8a0c1e0
BLAKE2b-256 47876348bf4c018608417e395c70ea2a85f8df1d86be8191725b3cdd8ee1188f

See more details on using hashes here.

Provenance

The following attestation bundles were made for optuna_lightning_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on LukeCPadmore/optuna-lightning-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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