Skip to main content

Jax coreset algorithms.

Reason this release was yanked:

Subdirectories not present in build.

Project description

Coreax logo

Coreax

Unit Tests Coverage Pre-commit Checks linting: pylint Python version PyPI Beta

© Crown Copyright GCHQ

Coreax is a library for coreset algorithms, written in JAX for fast execution and GPU support.

About Coresets

For $n$ points in $d$ dimensions, a coreset algorithm takes an $n \times d$ data set and reduces it to $m \ll n$ points whilst attempting to preserve the statistical properties of the full data set. The algorithm maintains the dimension of the original data set. Thus the $m$ points, referred to as the coreset, are also $d$-dimensional.

The $m$ points need not be in the original data set. We refer to the special case where all selected points are in the original data set as a coresubset.

Some algorithms return the $m$ points with weights, so that importance can be attributed to each point in the coreset. The weights, $w_i$ for $i=1,...,m$, are often chosen from the simplex. In this case, they are non-negative and sum to 1: $w_i >0$ $\forall i$ and $\sum_{i} w_i =1$.

Please see the documentation for some in-depth examples.

Example applications

Choosing pixels from an image

In the example below, we reduce the original 180x215 pixel image (38,700 pixels in total) to a coreset approximately 20% of this size. (Left) original image. (Centre) 8,000 coreset points chosen using Stein kernel herding, with point size a function of weight. (Right) 8,000 points chosen randomly. Run examples/david_map_reduce_weighted.py to replicate.

Video event detection

Here we identify representative frames such that most of the useful information in a video is preserved. Run examples/pounce.py to replicate.

Original Coreset

Setup

Before installing coreax, make sure JAX is installed. Be sure to install the preferred version of JAX for your system.

Install JAX noting that there are (currently) different setup paths for CPU and GPU use:

$ python3 -m pip install jax

Install Coreax:

$ python3 -m pip install coreax

Optionally, install additional dependencies required to run the examples:

$ python3 -m pip install coreax[test]

Should the installation fail, try again using stable pinned package versions. Note that these versions may be rather outdated, although we endeavour to avoid versions with known vulnerabilities. To install Coreax:

$ python3 -m pip install --no-dependencies -r requirements.txt

To run the examples, use requirements-test.txt instead.

Release cycle

We anticipate two release types: feature releases and security releases. Security releases will be issued as needed in accordance with the security policy. Feature releases will be issued as appropriate, dependent on the feature pipeline and development priorities.

Coming soon

Some features coming soon include:

  • Coordinate bootstrapping for high-dimensional data.
  • Other coreset-style algorithms, including recombination, as means to reducing a large dataset whilst maintaining properties of the underlying distribution.

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

coreax-0.3.0.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

coreax-0.3.0-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file coreax-0.3.0.tar.gz.

File metadata

  • Download URL: coreax-0.3.0.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for coreax-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddbc82390b0701f6a96808809d745c14954dbbd30aeebb7584efbe9ecd0ec9d3
MD5 2257c00fbad60a8c734d30597800cc84
BLAKE2b-256 981537fc3a59434dc9734a5dd8f192be19521deddeb5f3a360cddecf0d9475c3

See more details on using hashes here.

File details

Details for the file coreax-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: coreax-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for coreax-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a2a3187f0e004bcb1d37954a92b95eaca86ea4a61cc2f41af97b81d50da035
MD5 bfca884c6189f7b72dac64143df7fe44
BLAKE2b-256 7704e7897db8412b576b4cf1eeee123215cf6b1aba2e90caa675ca9afc75449a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page