Feature/numba integration - #99
Merged
Merged
Conversation
…d form Also fixes cpm.hierarchical discarding its population priors after the first evaluation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sion per call Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
numba is optional; without it, the same code runs as plain Python. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Results are unchanged, except that Softmax no longer overflows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Each application computes all trials in one loop, compiled with numba if it is installed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…piled loops Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the docs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Their outputs predated the population-prior fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oth bounds Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… them Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reset fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e used Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…used imports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…andas objects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes model fitting in cpm much faster, with the public API unchanged. numba is an optional extra (
pip install "cpm-toolbox[numba]"); without it, cpm runs the same code as plain Python.RLRW,HybridMBMF,PTSM,PTSM1992,PTSM2025) compute all trials of a participant at once. Fitting them is 90-220× faster with numba and 11-23× faster without, with the same results as main.cpm.generators.SessionWrapper, for your own models that compute all trials at once, andcpm.models.kernels, the formulas of thecpm.modelsclasses as functions numba can compile.Wrapperruns, losses and meta-d', with identical results.EmpiricalBayesandVariationalBayesdiscarding the updated population priors after the first evaluation. Hierarchical results change.numpy.random.seednow also reproduces their later chains.Other behaviour changes are listed in
CHANGELOG.mdunder 0.26.0.dev0.Testing
NUMBA_DISABLE_JIT=1. The docs build passes with warnings treated as errors.🤖 Generated with Claude Code