Skip to main content

Black box explorer

Project description

Uncharted: A package for exploring parameter spaces of functions

Uncharted provides a framework for exploring a function's parameter space using a variety of sampling algorithms, such as grid sampling, random sampling, or attempting to optimally sample the space by varying the local sampling density and minimizing the number of samples.

For many applications there exist computationally expensive functions or calculations, where one cannot expect the necessarily know the underlying structure of their parameter spaces. In these instances simple sampling methods such as grid sampling may either oversample the function (resulting in slower data acquisition times and increased storage requirements) or undersample it (resulting in inaccuracies such as aliasing or missing critical features). The aim of uncharted is to provide a means of efficiently exploring such parameter spaces in ways that minimize the total number of samples.

Installation

To install the latest release:

pip install uncharted

Quick-start guide

Assuming you have some function f(x) that you wish to explore where x: NDArray[(n,)] is an nD parameter space, this can be explored using

from uncharted import Explorer, Parameter
from uncharted.samplers import RandomSampler

params = (Parameter(0, 2), ..., Parameter(-1, 1))  # define the parameter space as a sequence of Parameters
explorer = Explorer(params=params, sampler=RandomSampler())  # instantiate an Explorer on the space
results = explorer.explore(f, n=100)  # explore the space using the requested sampler up to 100 points

For more control over sampling using the ask-and-tell interface:

from uncharted import EarlyTermination

for _ in range(n):
    x = explorer.ask(m)  # ask the assigned sampler for m samples to explore
    # x is an array of shape (m, n) - assume f is vectorized to handle this in this example
    y = f(x)  # compute the values at these points
    # assuming f is vectorized and has scalar output y will have shape (m,)
    try:
        explorer.tell(x, y)  # tell the explorer the values
    except EarlyTermination:  # if sufficient confidence has been achieved in
        break
results = explorer.results

Reference documentation

For details about the uncharted API, see .

Citing Uncharted

To cite this repository:

@software{uncharted2024github,
  author = {Alan Sanders},
  title = {{Uncharted}: A package for exploring parameter spaces of functions},
  url = {http://github.com/asanders/uncharted},
  version = {0.1.0},
  year = {2024},
}

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

uncharted-0.1.0.tar.gz (93.6 kB view details)

Uploaded Source

Built Distribution

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

uncharted-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uncharted-0.1.0.tar.gz
  • Upload date:
  • Size: 93.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for uncharted-0.1.0.tar.gz
Algorithm Hash digest
SHA256 639e923f636063111767d5529519cf415f151de84094afe14d0c22ac3aea421a
MD5 6e8117a49f402bdb17ebe19571d4371b
BLAKE2b-256 b3556786daa4eb4377ca8a49094580e1e3a77d1cd7ea328592b567c82d1636a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uncharted-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for uncharted-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2a84e32823e6ae306b796fb913afbe44543f36c1725a68f9955faf91000fd4
MD5 3f26791a45216de9de36df4f27aeff84
BLAKE2b-256 b684548035c78042d31babfb28c9d6f801b097ae0de4499019fe0876a04649c0

See more details on using hashes here.

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