Skip to content

Support feature index sequences in Subspace transforms - #286

Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
dfm:mainfrom
AHMETHAKANBEZIR1:fix/subspace-feature-sequences
Open

AHMETHAKANBEZIR1 wants to merge 1 commit into
dfm:mainfrom
AHMETHAKANBEZIR1:fix/subspace-feature-sequences

Conversation

@AHMETHAKANBEZIR1

Copy link
Copy Markdown

Subspace documents an integer or tuple of feature indices, but Subspace((0, 2), kernel) indexes each 1D coordinate with a multidimensional tuple and raises IndexError. List indices, also allowed by the Sequence[int] annotation, are rejected by JAX indexing.

Convert a sequence of feature indices to an index array before selecting coordinates. Preserve the existing scalar-integer path, including its scalar result.

Validation on Windows / Python 3.12.14 / JAX 0.12.0 / Equinox 0.13.8, CPU:

  • On unchanged main: 8 failing cases / 1 passing singleton-tuple control; all nine pass after the fix.
  • New and existing transform tests: 14 passed.
  • Full suite with default float32: 179 passed, 2 skipped; with JAX_ENABLE_X64=1: 179 passed, 2 skipped. The skips are optional george/celerite comparisons.
  • Source doctests: 3 passed. Configured pre-commit hooks and git diff --check pass; a news fragment is included.

Tests cover tuples/lists, reordered, negative, and singleton feature selections. A weighted-coordinate RBF reference checks covariance values and input gradients under JIT; a GP likelihood is compared with the explicitly selected covariance.

Prepared autonomously with OpenAI Codex, including code and tests; no independent human review is claimed.

Co-authored-by: OpenAI Codex <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant