Skip to main content

CMB-spectrum emulator competition: pre-generated training data, Wishart-likelihood scoring, and CPU timing harness built on classy_szfast.

Project description

cmbemu

A CMB power-spectrum emulator competition: pre-generated training/test data, Wishart-likelihood scoring, and a CPU timing harness built on classy_sz / classy_szfast.

Install

pip install cmbemu

Quickstart

import cmbemu as cec

# (1) Fetch the pre-generated datasets (cached under ~/.cache/cmbemu)
train = cec.load_train()
test  = cec.load_test()

# (2) Optionally generate more spectra to study data-scaling
extra = cec.generate_data(n=20_000, seed=42, save_to="extra.npz")

# (3) Define your emulator
class MyEmulator:
    def predict(self, params: dict) -> dict:
        # params has keys: omega_b, omega_cdm, H0, tau_reio,
        # ln10^{10}A_s, n_s.
        # Returns a dict with keys tt, te, ee (len lmax_cmb+1)
        # and pp (len lmax_pp+1).
        ...

# (4) Score
result = cec.get_score(MyEmulator())
print(result["combined_S"], result["mae_total"]["mae"], result["timing"]["t_cpu_ms_mean"])

See scoring.md for the full likelihood and score definitions.

Hardware note

Timing is done CPU-only, single-threaded warm sequential calls — this mimics how an emulator is used inside a typical MCMC chain. Before running get_score with strict_cpu=True, export:

export JAX_PLATFORMS=cpu
export CUDA_VISIBLE_DEVICES=

Project layout

  • src/cmbemu/ — the installable package
  • scripts/ — internal dataset-building and diagnostic scripts
  • scoring.md — formal score definition
  • STATUS.md — current state of the competition design

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

cmbemu-0.1.0a1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

cmbemu-0.1.0a1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file cmbemu-0.1.0a1.tar.gz.

File metadata

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

File hashes

Hashes for cmbemu-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 4681de94c8deed78521c88d720a455b02161b08d4140684fd8ac3550ecc82917
MD5 8f53caa237e13c98cda3cb489ca01120
BLAKE2b-256 f7e0fb44bce30e270911cc39927d6b77ea733b8c880872add32d400a258c3541

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on borisbolliet/cmbemu

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

File details

Details for the file cmbemu-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: cmbemu-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cmbemu-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f1e83be141a921f5db502fd070731e7a386eac9ec0d8de70b25c43f9ef8736
MD5 db19ff67836c06205f214b5afb4ec247
BLAKE2b-256 eaa4175306c84c03ba0d4b61f52885905d9c5420d9f24daa6bd76c9bdc9084d9

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on borisbolliet/cmbemu

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