Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interruptible samplers #321

Open
mdbenito opened this issue Mar 12, 2023 · 1 comment
Open

Interruptible samplers #321

mdbenito opened this issue Mar 12, 2023 · 1 comment
Labels
breaking-change Changes to the API enhancement New feature or request
Milestone

Comments

@mdbenito
Copy link
Collaborator

mdbenito commented Mar 12, 2023

#319 introduces PermutationSampler but it does not include the possibility of interrupting the sampling within a permutation, as required for TCMS.

One possibility would be to make samplers not simple Iterables but coroutines, with __iter__ returning a Generator[NDArray, bool, None] that accepts sent booleans to interrupt the sampling of a permutation. With this (and given that caching is enabled, see the comment in semivalues.py, but this is unrelated to the interruption), permutation_montecarlo_shapley and semivalues with shapley_coefficient and PermutationSampler should be equivalent.

Additionally, stratified samplers might require either simple interruption, or information from the utility computations. For instance, an adaptive variance-reducing sampler might require the status (running moments?) for each stratum separately.

@mdbenito mdbenito added enhancement New feature or request breaking-change Changes to the API labels Mar 12, 2023
@mdbenito mdbenito added this to the v0.6.0 milestone Mar 12, 2023
@mdbenito mdbenito mentioned this issue Mar 12, 2023
4 tasks
@mdbenito mdbenito changed the title TruncationPolicy for PermutationSampler Interruptible samplers Mar 16, 2023
@mdbenito mdbenito modified the milestones: v0.7.0, v0.8.0 Apr 20, 2023
@AnesBenmerzoug AnesBenmerzoug modified the milestones: v0.9.0, v0.10.0 Mar 18, 2024
@schroedk
Copy link
Collaborator

schroedk commented Jun 20, 2024

@janosg potentially resolved by #558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Changes to the API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants