-
Notifications
You must be signed in to change notification settings - Fork 14
Shapley analysis #2486
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
Draft
scarrazza
wants to merge
22
commits into
master
Choose a base branch
from
sv_analysis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Shapley analysis #2486
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
bb4ba45
Initial commit for the shapley value integration for NNPDF usage.
rbonnetguerrini cf0fff6
linking to shapley-values repo
rbonnetguerrini 9079a7c
fixing commenting
rbonnetguerrini 3ee96e2
adapting for all dataset type + includes variants and cfac in the loa…
rbonnetguerrini ef2d808
adding a progress tracker for the nbr of inference
dfc0133
test identity on cluster
rbonnetguerrini 3cbcfe0
example notebook for shapley values
rbonnetguerrini d83d0fa
integration of the parallele computing from https://github.com/rbonne…
rbonnetguerrini d373ef1
Several experiment per job, new perturbation types, ablation and cali…
rbonnetguerrini 370d067
making Shapley Values UQ + Fixing extreme SV outlier
rbonnetguerrini 66419f6
new plotting
rbonnetguerrini e3db0bf
few fixes + read me
rbonnetguerrini 3541813
small fixes
rbonnetguerrini ca2590b
new runcard sorting
rbonnetguerrini 8919c2c
small fixes runcards
rbonnetguerrini 5449120
adding new runcards, + reorganizing them
rbonnetguerrini 1c796fb
New UQ quantification for perturbation. Now set one perturbation mask…
rbonnetguerrini 73f33fd
Parallelizing the compute of each experiment within a runcard
rbonnetguerrini 514125e
new perturbation + dense heatmap plotting
rbonnetguerrini 2255f19
Add runcards for DY and DIS in flavour basis
evagroenendijk fb1c8f4
Runcards for CC and NC DIS in evolution basis
evagroenendijk abee282
Merge branch 'regression_stability' into sv_analysis
scarrazza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| """Shapley value analysis for NNPDF PDF flavour importance. | ||
|
|
||
| Subpackage of validphys that provides tools for computing exact Shapley values to quantify the importance of individual PDF flavours in constraining experimental observables. | ||
|
|
||
| Uses the external ``shapley_values`` package for the problem-agnostic available at https://github.com/rbonnetguerrini | ||
|
|
||
| Shapley computation, and wraps NNPDF-specific components: | ||
| - Dense FK tensor convolution for fast repeated chi2 evaluation | ||
| - Gaussian perturbation of PDF grid values | ||
| - MSR + VSR sum rule enforcement | ||
| - Evolution / physical-flavor basis support | ||
|
|
||
| Typical usage via CLI:: | ||
|
|
||
| vp-shapley runcards/sv_dis_hera.yaml | ||
|
|
||
| Or from Python:: | ||
|
|
||
| from validphys.shapley import ( | ||
| setup_observables, | ||
| NNPDFShapleyAnalyzer, | ||
| ) | ||
| """ | ||
|
|
||
| from .setup import ( | ||
| setup_observables, | ||
| get_pdf_grid_values, | ||
| get_pdf_flavor_grid_values, | ||
| get_pdf_grid_values_all14, | ||
| FKEntry, | ||
| NNPDFObservable, | ||
| FLAVOR_PDG_NAMES, | ||
| ) | ||
| from .perturbation import ( | ||
| gaussian_profile, | ||
| apply_gaussian_perturbation, | ||
| PERTURBATION_MODES, | ||
| PERTURBATION_XSPACES, | ||
| ) | ||
| from .sumrules import ( | ||
| gen_integration_input, | ||
| compute_sumrule_normalization, | ||
| ) | ||
| from .analyzer import NNPDFShapleyAnalyzer | ||
|
|
||
| __all__ = [ | ||
| # Setup | ||
| "setup_observables", | ||
| "get_pdf_grid_values", | ||
| "get_pdf_flavor_grid_values", | ||
| "get_pdf_grid_values_all14", | ||
| "FKEntry", | ||
| "NNPDFObservable", | ||
| "FLAVOR_PDG_NAMES", | ||
| # Perturbation | ||
| "gaussian_profile", | ||
| "apply_gaussian_perturbation", | ||
| "PERTURBATION_MODES", | ||
| "PERTURBATION_XSPACES", | ||
| # Sum rules | ||
| "gen_integration_input", | ||
| "compute_sumrule_normalization", | ||
| # Analyzer | ||
| "NNPDFShapleyAnalyzer", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest @rbonnetguerrini to make a release of his code and upload to PyPI, so we avoid installing from git.