Skip to main content

Prometheus metrics collectors for Keras

Project description

Gangplank

Export Keras metrics to Prometheus

Prometheus is a monitoring system that pulls metrics from applications and infrastructure. While polling works for applications that are continuously running, scraping metrics does not work well with batch jobs such as machine learning training or evaluation jobs. The Prometheus Pushgateway is middleware that connects batch jobs to Prometheus.

Gangplank is a Keras callback for pushing Keras training and testing metrics to Prometheus via a pushgateway.

What metrics are exported?

During training, the following metrics are exported:

  • The number of completed training epochs
  • The time spent training
  • The number of model weights (both trainable and non-trainable)
  • The model's loss
  • All metrics configured for the model (e.g. accuracy for a classification model or mean absolute error for a regression model)
  • (Optionally) A histogram of the model's trainable weights at the end of the training run

For testing (i.e. evaluation), the following metrics are exported:

  • The time spent testing
  • The model's loss
  • All metrics configured for the model (accuracy, mean absolute error, etc.)
  • (Optionally) A histogram of the model's trainable weights

Installing Gangplank

Gangplank can be installed from PyPI

pip install gangplank

The installation will also install Keras. Keras needs a tensor arithmetic backend like tensorflow, JAX or PyTorch. You can install a backend at the same time as installing Gangplank by running one of the following

pip install gangplank[tensorflow]
pip install gangplank[jax]
pip install gangplank[torch]

Note: Running, e.g., pip install gangplank[jax] will install a CPU-only version of JAX. If you want, say, CUDA support you should install JAX separately

pip install gangplank
pip install jax[cuda12]

Similar comments apply to tensorflow and PyTorch.

Examples

An example of using Gangplank can be found in the github repository.

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

gangplank-0.2.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

gangplank-0.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file gangplank-0.2.0.tar.gz.

File metadata

  • Download URL: gangplank-0.2.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gangplank-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4e98c49dd24f2b9e3b6b88e8729a1ae6e3ef5d443765230cc2cd38d6c778e7ee
MD5 88b1d5245d6b540638474b16a2d93d83
BLAKE2b-256 54dd0c60e62ccfc5c72050070139a8c81c6ed3110b2cf01a47f2c0e800b0927b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gangplank-0.2.0.tar.gz:

Publisher: publish-to-pypi.yml on hammingweight/gangplank

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

File details

Details for the file gangplank-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gangplank-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gangplank-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd7cd7c328e74151a2cfcaa79f44d192f1bcc0891f40b90214bdc8d1c27290fc
MD5 50e17481c9f8ae84718d2817316d41a6
BLAKE2b-256 25cbc76e9e5d639becef5363bf0f4f7b4e771ceb4e6fe89a495ba643e8a00eec

See more details on using hashes here.

Provenance

The following attestation bundles were made for gangplank-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on hammingweight/gangplank

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