High-dimensional Online Particle Estimation (HOPE) for psychophysical experiments
Project description
High-dimensional Online Particle Estimation (HOPE) for psychophysical experiments
HOPE (High-dimensional Online Particle Estimation) is a Python package for adaptive psychophysics experiments.
Given a parametric psychometric function and a discrete stimulus pool, it selects the next stimulus with maximum expected information gain. It uses a posterior approximation based on a combined particle filtering–MCMC approach. This is fast enough for real-time use within the inter-stimulus interval for feature spaces up to 50 dimensions, typically under one second on standard hardware and with a stimulus pool of 10,000 stimuli. The package includes a set of predefined psychometric functions, but users can also supply their own. It is designed to integrate with PsychoPy experiments.
Installation
You can install HOPE using pip:
pip install psihope
Usage
from hope import HopeSampler
from hope.psychometric_functions import logistic_regression
from hope.psychometric_model import BinaryPsychometricModel
# 1. Define your priors
priors = {
"bias": stats.norm(scale=1),
"weights": stats.multivariate_normal(mean=np.zeros(2), cov=np.eye(2)),
}
# 2. Define your model
psychometric_model = BinaryPsychometricModel(
psychometric_function=logistic_regression, # choose from our library of psychometric functions or define your own
priors=priors,
)
# 3. Initialize the sampler
# define your stimulus pool here as a list of stimulus configurations
stimulus_pool = ...
sampler = HopeSampler(
psychometric_model=psychometric_model,
stimulus_pool=stimulus_pool,
seed=seed,
)
# 4. Run the experiment
for trial in range(num_trials):
stimulus = sampler.get_next_stimulus()
# Collect response from participant using e.g. PsychoPy
response = ...
sampler.update_posterior(stimulus, response)
For more advanced usage and more explanations refer to the examples directory.
Citation
TODO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file psihope-0.1.0.tar.gz.
File metadata
- Download URL: psihope-0.1.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5ba4a7e73cb48bb03ea79c551670d1860493c0dad17aa980c21eb14a0eb1f92
|
|
| MD5 |
34d06da0594b98dfa9e75133ba0f89d0
|
|
| BLAKE2b-256 |
e897010798100ed9badbb35c67bc67a4f40c466031bf5a421e837eb251670592
|
Provenance
The following attestation bundles were made for psihope-0.1.0.tar.gz:
Publisher:
release.yml on ag-perception-wallis-lab/hope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psihope-0.1.0.tar.gz -
Subject digest:
c5ba4a7e73cb48bb03ea79c551670d1860493c0dad17aa980c21eb14a0eb1f92 - Sigstore transparency entry: 1842029094
- Sigstore integration time:
-
Permalink:
ag-perception-wallis-lab/hope@ab2fe8211b293fb6d27f556eb04926fa830df975 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ag-perception-wallis-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab2fe8211b293fb6d27f556eb04926fa830df975 -
Trigger Event:
release
-
Statement type:
File details
Details for the file psihope-0.1.0-py3-none-any.whl.
File metadata
- Download URL: psihope-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
430b74b1807c20314f6323b7a5b16aa1e1cf87aabd60ec065a2872eb4dad7c3d
|
|
| MD5 |
e7a7608a7c305729b7f222760b548a03
|
|
| BLAKE2b-256 |
f4f2ba1c064d619205846d7c090839df1b2ec7cb6da965be78044d0eb710f788
|
Provenance
The following attestation bundles were made for psihope-0.1.0-py3-none-any.whl:
Publisher:
release.yml on ag-perception-wallis-lab/hope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psihope-0.1.0-py3-none-any.whl -
Subject digest:
430b74b1807c20314f6323b7a5b16aa1e1cf87aabd60ec065a2872eb4dad7c3d - Sigstore transparency entry: 1842029308
- Sigstore integration time:
-
Permalink:
ag-perception-wallis-lab/hope@ab2fe8211b293fb6d27f556eb04926fa830df975 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ag-perception-wallis-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab2fe8211b293fb6d27f556eb04926fa830df975 -
Trigger Event:
release
-
Statement type: