© Crown Copyright GCHQ
Coreax is a library for coreset algorithms, written in JAX for fast execution and GPU support.
For
The
Some algorithms return the
Please see the documentation for some in-depth examples.
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.
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 |
---|---|
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.
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.
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.