From db49f70d1c6642f017958d7ea256186dc20581c5 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 11:14:02 +0200 Subject: [PATCH 01/11] Bump versions of docs dependencies --- requirements-docs.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 662775a9f..18b062aba 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,20 +1,18 @@ -griffe==0.42.1 -mike==2.0.0 +mkdocs==1.6.0 +mkdocs-material[imaging]==9.5.27 +mike==2.1.2 +griffe==0.47.0 markdown-captions -mkdocs==1.5.3 -mkdocstrings[python]>=0.24 -mkdocstrings-python==1.9.0 -# There is a bug in version 0.8.0 with type hints -# https://github.com/aai-institute/pyDVL/actions/runs/8598810209/job/23560394768 -mkdocs-alias-plugin==0.7.1 +mkdocstrings[python]==0.25.1 +mkdocstrings-python==1.10.5 +mkdocs-alias-plugin==0.8.1 mkdocs-autorefs==1.0.1 -mkdocs-bibtex==2.15.0 +mkdocs-bibtex==2.16.0 mkdocs-gen-files mkdocs-git-revision-date-localized-plugin mkdocs-glightbox==0.3.7 mkdocs-literate-nav -mkdocs-material[imaging]==9.5.16 -mkdocs-section-index==0.3.8 +mkdocs-section-index==0.3.9 mkdocs-macros-plugin mknotebooks==0.8.0 pygments From 2f7247d79d6fab3c36be2c9119d5b38cd8bc13e4 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 11:16:33 +0200 Subject: [PATCH 02/11] Fix description on getting started card --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 0da898ebf..f95b8c118 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ If you're a first time user of pyDVL, we recommend you to go through [[getting-started|__Getting started__]] --- - Steps to install and requirements + Steps to install pyDVL and its requirements - :fontawesome-regular-images:{ .lg .middle } [[examples|__Example gallery__]] From a551c64513dea38f08f3ce64685803c3f80ac61c Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 11:17:52 +0200 Subject: [PATCH 03/11] Change description of getting started card --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f95b8c118..4baaf08f7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ If you're a first time user of pyDVL, we recommend you to go through [[getting-started|__Getting started__]] --- - Steps to install pyDVL and its requirements + New users of pyDVL should read this first - :fontawesome-regular-images:{ .lg .middle } [[examples|__Example gallery__]] From 5c5bed40c0cf2017c82d4ed9cff2bfc1a186cf5d Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 11:26:45 +0200 Subject: [PATCH 04/11] Move existing docs structure under new section --- docs/previous_index.md | 59 ++++++++++++++++++++++++++++++++++ mkdocs.yml | 72 ++++++++++++++++++++++-------------------- 2 files changed, 96 insertions(+), 35 deletions(-) create mode 100644 docs/previous_index.md diff --git a/docs/previous_index.md b/docs/previous_index.md new file mode 100644 index 000000000..0da898ebf --- /dev/null +++ b/docs/previous_index.md @@ -0,0 +1,59 @@ +--- +title: Home +--- + +# The python library for data valuation + +pyDVL collects algorithms for data valuation and influence function computation. +For the full list see [[methods]]. It supports out-of-core and distributed +computation, as well as local or distributed caching of results. + +If you're a first time user of pyDVL, we recommend you to go through +[[getting-started]]. + + +
+ +- :fontawesome-solid-toolbox:{ .lg .middle } + [[getting-started|__Getting started__]] + + --- + Steps to install and requirements + +- :fontawesome-regular-images:{ .lg .middle } + [[examples|__Example gallery__]] + + --- + + Notebooks with worked-out examples of data valuation and influence functions + +- :fontawesome-solid-scale-unbalanced:{ .lg .middle } + [[data-valuation|__Data valuation__]] + + --- + + Basics of data valuation and description of the main algorithms + +- :fontawesome-solid-scale-unbalanced-flip:{ .lg .middle } + [[influence-function|__Influence Function__]] + + --- + + An introduction to the influence function and its computation with pyDVL + +- :material-cog:{ .lg .middle } + [[methods|__Supported methods__]] + + --- + + List of all methods implemented with references. + + +- :fontawesome-regular-file-code:{ .lg .middle } + [__API Reference__](api/pydvl/) + + --- + + Full documentation of the API + +
diff --git a/mkdocs.yml b/mkdocs.yml index 6c8732760..a2be477ba 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,42 +8,44 @@ remote_branch: gh-pages nav: - Home: index.md - - Getting Started: - - getting-started/index.md - - First steps: getting-started/first-steps.md - - Applications: getting-started/applications.md - - Benchmarking: getting-started/benchmarking.md - - Methods: getting-started/methods.md - - Advanced usage: getting-started/advanced-usage.md - - Glossary: getting-started/glossary.md - - Data Valuation: - - value/index.md - - Shapley values: value/shapley.md - - Semi-values: value/semi-values.md - - The Core: value/the-core.md - - Class-wise Shapley: value/classwise-shapley.md - - The Influence Function: - - influence/index.md - - Influence Function Model: influence/influence_function_model.md - - Scaling Computation: influence/scaling_computation.md - - Examples: - - examples/index.md + - Previous Structure: + - Home: previous_index.md + - Getting Started: + - getting-started/index.md + - First steps: getting-started/first-steps.md + - Applications: getting-started/applications.md + - Benchmarking: getting-started/benchmarking.md + - Methods: getting-started/methods.md + - Advanced usage: getting-started/advanced-usage.md + - Glossary: getting-started/glossary.md - Data Valuation: - - Shapley values: examples/shapley_basic_spotify.ipynb - - KNN Shapley: examples/shapley_knn_flowers.ipynb - - Data utility learning: examples/shapley_utility_learning.ipynb - - Least Core: examples/least_core_basic.ipynb - - Data OOB: examples/data_oob.ipynb - - Banzhaf Semivalues: examples/msr_banzhaf_digits.ipynb - - Influence Function: - - For CNNs: examples/influence_imagenet.ipynb - - For mislabeled data: examples/influence_synthetic.ipynb - - For outlier detection: examples/influence_wine.ipynb - - For language models: examples/influence_sentiment_analysis.ipynb - - Code: - - API Reference: api/pydvl/ - - Changelog: CHANGELOG.md - - Development Guidelines: CONTRIBUTING.md + - value/index.md + - Shapley values: value/shapley.md + - Semi-values: value/semi-values.md + - The Core: value/the-core.md + - Class-wise Shapley: value/classwise-shapley.md + - The Influence Function: + - influence/index.md + - Influence Function Model: influence/influence_function_model.md + - Scaling Computation: influence/scaling_computation.md + - Examples: + - examples/index.md + - Data Valuation: + - Shapley values: examples/shapley_basic_spotify.ipynb + - KNN Shapley: examples/shapley_knn_flowers.ipynb + - Data utility learning: examples/shapley_utility_learning.ipynb + - Least Core: examples/least_core_basic.ipynb + - Data OOB: examples/data_oob.ipynb + - Banzhaf Semivalues: examples/msr_banzhaf_digits.ipynb + - Influence Function: + - For CNNs: examples/influence_imagenet.ipynb + - For mislabeled data: examples/influence_synthetic.ipynb + - For outlier detection: examples/influence_wine.ipynb + - For language models: examples/influence_sentiment_analysis.ipynb + - Code: + - API Reference: api/pydvl/ + - Changelog: CHANGELOG.md + - Development Guidelines: CONTRIBUTING.md watch: - src/pydvl From 90fc2794da3d9a37d4bd060969e543cf9645b84c Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:39:19 +0200 Subject: [PATCH 05/11] Change path and name of output of some docs build scripts --- build_scripts/copy_changelog.py | 2 +- build_scripts/copy_contributing_guide.py | 2 +- build_scripts/generate_api_docs.py | 7 +- ...se-shapley-discounted-utility-function.svg | 3 - docs/getting-started/methods.md | 69 ------------------- docs/previous_index.md | 59 ---------------- 6 files changed, 7 insertions(+), 135 deletions(-) delete mode 100644 docs/api/pydvl/value/shapley/classwise/img/classwise-shapley-discounted-utility-function.svg delete mode 100644 docs/getting-started/methods.md delete mode 100644 docs/previous_index.md diff --git a/build_scripts/copy_changelog.py b/build_scripts/copy_changelog.py index 21de453da..9ea410a52 100644 --- a/build_scripts/copy_changelog.py +++ b/build_scripts/copy_changelog.py @@ -9,7 +9,7 @@ root_dir = Path(__file__).parent.parent docs_dir = root_dir / "docs" changelog_file = root_dir / "CHANGELOG.md" -target_filepath = docs_dir / changelog_file.name +target_filepath = docs_dir / "changelog.md" @mkdocs.plugins.event_priority(100) diff --git a/build_scripts/copy_contributing_guide.py b/build_scripts/copy_contributing_guide.py index 0c4b2fbf2..146a44b65 100644 --- a/build_scripts/copy_contributing_guide.py +++ b/build_scripts/copy_contributing_guide.py @@ -9,7 +9,7 @@ root_dir = Path(__file__).parent.parent docs_dir = root_dir / "docs" contributing_file = root_dir / "CONTRIBUTING.md" -target_filepath = docs_dir / contributing_file.name +target_filepath = docs_dir / "development_guidelines.md" @mkdocs.plugins.event_priority(100) diff --git a/build_scripts/generate_api_docs.py b/build_scripts/generate_api_docs.py index 99751aaa8..99aab88fc 100644 --- a/build_scripts/generate_api_docs.py +++ b/build_scripts/generate_api_docs.py @@ -3,12 +3,15 @@ import mkdocs_gen_files +SOURCE_PATH = "src" +API_REFERENCE_PATH = "api/development/reference" + nav = mkdocs_gen_files.Nav() -root = Path("src") # / Path("pydvl") +root = Path(SOURCE_PATH) for path in sorted(root.rglob("*.py")): module_path = path.relative_to(root).with_suffix("") doc_path = path.relative_to(root).with_suffix(".md") - full_doc_path = Path("api") / doc_path + full_doc_path = Path(API_REFERENCE_PATH) / doc_path parts = tuple(module_path.parts) if parts[-1] == "__init__": diff --git a/docs/api/pydvl/value/shapley/classwise/img/classwise-shapley-discounted-utility-function.svg b/docs/api/pydvl/value/shapley/classwise/img/classwise-shapley-discounted-utility-function.svg deleted file mode 100644 index 78f84d0f3..000000000 --- a/docs/api/pydvl/value/shapley/classwise/img/classwise-shapley-discounted-utility-function.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ca6951b6a40d0a061432b6508772dc8bef2c2547c69d369d8966a37b50d551aa -size 3528731 diff --git a/docs/getting-started/methods.md b/docs/getting-started/methods.md deleted file mode 100644 index abd9d2dc1..000000000 --- a/docs/getting-started/methods.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Methods -alias: - name: methods - text: Methods ---- - -We currently implement the following methods: - -## Data valuation - -- [**LOO**][pydvl.value.loo.compute_loo]. - -- [**Permutation Shapley**][pydvl.value.shapley.montecarlo.permutation_montecarlo_shapley] - (also called **ApproxShapley**) [@castro_polynomial_2009]. - -- [**TMCS**][pydvl.value.shapley.compute_shapley_values] - [@ghorbani_data_2019]. - -- [**Data Banzhaf**][pydvl.value.semivalues.compute_banzhaf_semivalues] - [@wang_data_2022]. - -- [**Beta Shapley**][pydvl.value.semivalues.compute_beta_shapley_semivalues] - [@kwon_beta_2022]. - -- [**CS-Shapley**][pydvl.value.shapley.classwise.compute_classwise_shapley_values] - [@schoch_csshapley_2022]. - -- [**Least Core**][pydvl.value.least_core.montecarlo.montecarlo_least_core] - [@yan_if_2021]. - -- [**Owen Sampling**][pydvl.value.shapley.owen.owen_sampling_shapley] - [@okhrati_multilinear_2021]. - -- [**Data Utility Learning**][pydvl.utils.utility.DataUtilityLearning] - [@wang_improving_2022]. - -- [**kNN-Shapley**][pydvl.value.shapley.knn.knn_shapley] - [@jia_efficient_2019a]. - -- [**Group Testing**][pydvl.value.shapley.gt.group_testing_shapley] - [@jia_efficient_2019] - -- [**Data-OOB**][pydvl.value.oob.compute_data_oob] - [@kwon_dataoob_2023]. - -## Influence functions - -- [**CG Influence**][pydvl.influence.torch.CgInfluence]. - [@koh_understanding_2017]. - -- [**Direct Influence**][pydvl.influence.torch.DirectInfluence] - [@koh_understanding_2017]. - -- [**LiSSA**][pydvl.influence.torch.LissaInfluence] - [@agarwal_secondorder_2017]. - -- [**Arnoldi Influence**][pydvl.influence.torch.ArnoldiInfluence] - [@schioppa_scaling_2022]. - -- [**EKFAC Influence**][pydvl.influence.torch.EkfacInfluence] - [@george_fast_2018;@martens_optimizing_2015]. - -- [**Nyström Influence**][pydvl.influence.torch.NystroemSketchInfluence], based - on the ideas in [@hataya_nystrom_2023] for bi-level optimization. - -- [**Inverse-harmonic-mean Influence**][pydvl.influence.torch.InverseHarmonicMeanInfluence] - [@kwon_datainf_2023]. - diff --git a/docs/previous_index.md b/docs/previous_index.md deleted file mode 100644 index 0da898ebf..000000000 --- a/docs/previous_index.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: Home ---- - -# The python library for data valuation - -pyDVL collects algorithms for data valuation and influence function computation. -For the full list see [[methods]]. It supports out-of-core and distributed -computation, as well as local or distributed caching of results. - -If you're a first time user of pyDVL, we recommend you to go through -[[getting-started]]. - - -
- -- :fontawesome-solid-toolbox:{ .lg .middle } - [[getting-started|__Getting started__]] - - --- - Steps to install and requirements - -- :fontawesome-regular-images:{ .lg .middle } - [[examples|__Example gallery__]] - - --- - - Notebooks with worked-out examples of data valuation and influence functions - -- :fontawesome-solid-scale-unbalanced:{ .lg .middle } - [[data-valuation|__Data valuation__]] - - --- - - Basics of data valuation and description of the main algorithms - -- :fontawesome-solid-scale-unbalanced-flip:{ .lg .middle } - [[influence-function|__Influence Function__]] - - --- - - An introduction to the influence function and its computation with pyDVL - -- :material-cog:{ .lg .middle } - [[methods|__Supported methods__]] - - --- - - List of all methods implemented with references. - - -- :fontawesome-regular-file-code:{ .lg .middle } - [__API Reference__](api/pydvl/) - - --- - - Full documentation of the API - -
From 6033d65b504b597ad1f720131b5b81e79bf4f367 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:39:40 +0200 Subject: [PATCH 06/11] Fix mathjax loading issue --- docs/javascripts/mathjax.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js index 06dbf38bf..7e48906af 100644 --- a/docs/javascripts/mathjax.js +++ b/docs/javascripts/mathjax.js @@ -12,5 +12,8 @@ window.MathJax = { }; document$.subscribe(() => { + MathJax.startup.output.clearCache() + MathJax.typesetClear() + MathJax.texReset() MathJax.typesetPromise() }) From 22b20e09dc5f650ea476935d1d1ab178ef4b95ed Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:39:51 +0200 Subject: [PATCH 07/11] Restructure documentation --- docs/api/development/index.md | 31 ++++++++++++++++++++ docs/api/index.md | 22 ++++++++++++++ docs/api/user-api/index.md | 6 ++++ docs/how-to-guides/index.md | 7 +++++ docs/index.md | 42 +++++++++----------------- docs/influence/index.md | 23 +++++++++++++++ docs/methods/index.md | 24 +++++++++++++++ docs/tutorials/index.md | 6 ++++ docs/value/index.md | 37 +++++++++++++++++++++++ mkdocs.yml | 55 ++++++++++++++++++++--------------- 10 files changed, 200 insertions(+), 53 deletions(-) create mode 100644 docs/api/development/index.md create mode 100644 docs/api/index.md create mode 100644 docs/api/user-api/index.md create mode 100644 docs/how-to-guides/index.md create mode 100644 docs/methods/index.md create mode 100644 docs/tutorials/index.md diff --git a/docs/api/development/index.md b/docs/api/development/index.md new file mode 100644 index 000000000..5e077e4fd --- /dev/null +++ b/docs/api/development/index.md @@ -0,0 +1,31 @@ +--- +title: Development +alias: + name: development + title: Development +--- + +
+ +- :fontawesome-solid-code:{ .lg .middle } + [__API Reference__](reference/pydvl) + + --- + Full documentation of the API + + +- :fontawesome-solid-timeline:{ .lg .middle } + [__Changelog__](/changelog) + + --- + Chronologically ordered list of notable changes for each version + of pyDVL. + + +- :fontawesome-solid-screwdriver-wrench:{ .lg .middle } + [__Development Guidelines__](/development_guidelines) + + --- + Development guidelines + +
\ No newline at end of file diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 000000000..7b6766908 --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,22 @@ +--- +title: API +alias: + name: api + title: API +--- + +
+ +- :fontawesome-solid-code:{ .lg .middle } + [[user-api|__User API__]] + + --- + Documentation of the User API + +- :fontawesome-solid-screwdriver-wrench:{ .lg .middle } + [[development|__Development__]] + + --- + Full API Documentation, Changelog and Guidelines + +
diff --git a/docs/api/user-api/index.md b/docs/api/user-api/index.md new file mode 100644 index 000000000..a50ac966a --- /dev/null +++ b/docs/api/user-api/index.md @@ -0,0 +1,6 @@ +--- +title: User API +alias: + name: user-api + title: User API +--- diff --git a/docs/how-to-guides/index.md b/docs/how-to-guides/index.md new file mode 100644 index 000000000..b90f17307 --- /dev/null +++ b/docs/how-to-guides/index.md @@ -0,0 +1,7 @@ +--- +title: How-to Guides +alias: + name: how-to-guides + title: How-to Guides +--- + diff --git a/docs/index.md b/docs/index.md index 4baaf08f7..ecd7dbf0a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,42 +18,26 @@ If you're a first time user of pyDVL, we recommend you to go through [[getting-started|__Getting started__]] --- - New users of pyDVL should read this first + New users of pyDVL should read this first. -- :fontawesome-regular-images:{ .lg .middle } - [[examples|__Example gallery__]] - - --- - - Notebooks with worked-out examples of data valuation and influence functions - -- :fontawesome-solid-scale-unbalanced:{ .lg .middle } - [[data-valuation|__Data valuation__]] - - --- - - Basics of data valuation and description of the main algorithms - -- :fontawesome-solid-scale-unbalanced-flip:{ .lg .middle } - [[influence-function|__Influence Function__]] +- :fontawesome-solid-book-open:{ .lg .middle } + [[how-to-guides|__How-to Guides__]] --- + Detailed instructions for specific and advanced tasks. - An introduction to the influence function and its computation with pyDVL - -- :material-cog:{ .lg .middle } - [[methods|__Supported methods__]] +- :fontawesome-solid-book-atlas:{ .lg .middle } + [[methods|__Methods__]] --- + Background information and explanations of data valuation + and influence function methods. - List of all methods implemented with references. - - -- :fontawesome-regular-file-code:{ .lg .middle } - [__API Reference__](api/pydvl/) - +- :fontawesome-regular-images:{ .lg .middle } + [[tutorials|__Tutorials__]] + --- - - Full documentation of the API + Worked-out examples of data valuation and influence function methods + showing how to do certain tasks using pyDVL. diff --git a/docs/influence/index.md b/docs/influence/index.md index 7cc89a708..aa16f2e9a 100644 --- a/docs/influence/index.md +++ b/docs/influence/index.md @@ -30,6 +30,29 @@ pyDVL implements several methods for the efficient computation of the IF for machine learning. In the examples we document some of the difficulties that can arise when using the IF. +We currently implement the following methods: + +- [**CG Influence**][pydvl.influence.torch.CgInfluence]. + [@koh_understanding_2017]. + +- [**Direct Influence**][pydvl.influence.torch.DirectInfluence] + [@koh_understanding_2017]. + +- [**LiSSA**][pydvl.influence.torch.LissaInfluence] + [@agarwal_secondorder_2017]. + +- [**Arnoldi Influence**][pydvl.influence.torch.ArnoldiInfluence] + [@schioppa_scaling_2022]. + +- [**EKFAC Influence**][pydvl.influence.torch.EkfacInfluence] + [@george_fast_2018;@martens_optimizing_2015]. + +- [**Nyström Influence**][pydvl.influence.torch.NystroemSketchInfluence], based + on the ideas in [@hataya_nystrom_2023] for bi-level optimization. + +- [**Inverse-harmonic-mean Influence**][pydvl.influence.torch.InverseHarmonicMeanInfluence] + [@kwon_datainf_2023]. + ## Construction First introduced in the context of robust statistics in [@hampel_influence_1974], diff --git a/docs/methods/index.md b/docs/methods/index.md new file mode 100644 index 000000000..278cdbf80 --- /dev/null +++ b/docs/methods/index.md @@ -0,0 +1,24 @@ +--- +title: Methods +alias: + name: methods + title: Methods +--- + +
+ +- :fontawesome-solid-scale-unbalanced:{ .lg .middle } + [[data-valuation|__Data valuation__]] + + --- + + Basics of data valuation and description of the main algorithms + +- :fontawesome-solid-scale-unbalanced-flip:{ .lg .middle } + [[influence-function|__Influence Function__]] + + --- + + An introduction to the influence function and its computation with pyDVL + +
diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md new file mode 100644 index 000000000..58fe2cbf4 --- /dev/null +++ b/docs/tutorials/index.md @@ -0,0 +1,6 @@ +--- +title: Tutorials +alias: + name: tutorials + text: Tutorials +--- diff --git a/docs/value/index.md b/docs/value/index.md index 6ddc974d0..bb0d87a6b 100644 --- a/docs/value/index.md +++ b/docs/value/index.md @@ -50,6 +50,43 @@ influence-based and intrinsic. As of v0.8.1 pyDVL supports the first two. Here, we focus on game-theoretic concepts and refer to the main documentation on the [influence funtion][the-influence-function] for the second. +We currently implement the following methods: + +- [**LOO**][pydvl.value.loo.compute_loo]. + +- [**Permutation Shapley**][pydvl.value.shapley.montecarlo.permutation_montecarlo_shapley] + (also called **ApproxShapley**) [@castro_polynomial_2009]. + +- [**TMCS**][pydvl.value.shapley.compute_shapley_values] + [@ghorbani_data_2019]. + +- [**Data Banzhaf**][pydvl.value.semivalues.compute_banzhaf_semivalues] + [@wang_data_2022]. + +- [**Beta Shapley**][pydvl.value.semivalues.compute_beta_shapley_semivalues] + [@kwon_beta_2022]. + +- [**CS-Shapley**][pydvl.value.shapley.classwise.compute_classwise_shapley_values] + [@schoch_csshapley_2022]. + +- [**Least Core**][pydvl.value.least_core.montecarlo.montecarlo_least_core] + [@yan_if_2021]. + +- [**Owen Sampling**][pydvl.value.shapley.owen.owen_sampling_shapley] + [@okhrati_multilinear_2021]. + +- [**Data Utility Learning**][pydvl.utils.utility.DataUtilityLearning] + [@wang_improving_2022]. + +- [**kNN-Shapley**][pydvl.value.shapley.knn.knn_shapley] + [@jia_efficient_2019a]. + +- [**Group Testing**][pydvl.value.shapley.gt.group_testing_shapley] + [@jia_efficient_2019] + +- [**Data-OOB**][pydvl.value.oob.compute_data_oob] + [@kwon_dataoob_2023]. + ## Game theoretical methods The main contenders in game-theoretic approaches are [Shapley diff --git a/mkdocs.yml b/mkdocs.yml index a2be477ba..225e952b6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,16 +8,17 @@ remote_branch: gh-pages nav: - Home: index.md - - Previous Structure: - - Home: previous_index.md - - Getting Started: - - getting-started/index.md - - First steps: getting-started/first-steps.md - - Applications: getting-started/applications.md - - Benchmarking: getting-started/benchmarking.md - - Methods: getting-started/methods.md - - Advanced usage: getting-started/advanced-usage.md - - Glossary: getting-started/glossary.md + - Getting Started: + - getting-started/index.md + - First steps: getting-started/first-steps.md + - Applications: getting-started/applications.md + - Benchmarking: getting-started/benchmarking.md + - Advanced usage: getting-started/advanced-usage.md + - Glossary: getting-started/glossary.md + - How-to Guides: + - how-to-guides/index.md + - Methods: + - methods/index.md - Data Valuation: - value/index.md - Shapley values: value/shapley.md @@ -28,24 +29,30 @@ nav: - influence/index.md - Influence Function Model: influence/influence_function_model.md - Scaling Computation: influence/scaling_computation.md - - Examples: - - examples/index.md - - Data Valuation: - - Shapley values: examples/shapley_basic_spotify.ipynb - - KNN Shapley: examples/shapley_knn_flowers.ipynb - - Data utility learning: examples/shapley_utility_learning.ipynb - - Least Core: examples/least_core_basic.ipynb - - Data OOB: examples/data_oob.ipynb - - Banzhaf Semivalues: examples/msr_banzhaf_digits.ipynb - - Influence Function: + - Tutorials: + - tutorials/index.md + - Examples: + - examples/index.md + - Data Valuation: + - Shapley values: examples/shapley_basic_spotify.ipynb + - KNN Shapley: examples/shapley_knn_flowers.ipynb + - Data utility learning: examples/shapley_utility_learning.ipynb + - Least Core: examples/least_core_basic.ipynb + - Data OOB: examples/data_oob.ipynb + - Banzhaf Semivalues: examples/msr_banzhaf_digits.ipynb + - Influence Function: - For CNNs: examples/influence_imagenet.ipynb - For mislabeled data: examples/influence_synthetic.ipynb - For outlier detection: examples/influence_wine.ipynb - For language models: examples/influence_sentiment_analysis.ipynb - - Code: - - API Reference: api/pydvl/ - - Changelog: CHANGELOG.md - - Development Guidelines: CONTRIBUTING.md + - API: + - api/index.md + - User API: api/user-api/index.md + - Development: + - api/development/index.md + - API Reference: api/development/reference/ + - Changelog: changelog.md + - Development Guidelines: contributing.md watch: - src/pydvl From 42aac3c851eaf0d8902392f2b4a6b9a17960d440 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:41:58 +0200 Subject: [PATCH 08/11] Remove unused icons --- docs/assets/material-code.svg | 3 --- docs/assets/material-computer.svg | 3 --- docs/assets/material-description.svg | 3 --- docs/assets/material-toolbox.svg | 3 --- 4 files changed, 12 deletions(-) delete mode 100644 docs/assets/material-code.svg delete mode 100644 docs/assets/material-computer.svg delete mode 100644 docs/assets/material-description.svg delete mode 100644 docs/assets/material-toolbox.svg diff --git a/docs/assets/material-code.svg b/docs/assets/material-code.svg deleted file mode 100644 index 28cd55f17..000000000 --- a/docs/assets/material-code.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fa8d133be89acd6e75badb86085a675fcb6a5c17024871a7fb735b097d3f7cf -size 207 diff --git a/docs/assets/material-computer.svg b/docs/assets/material-computer.svg deleted file mode 100644 index 8ba427c82..000000000 --- a/docs/assets/material-computer.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8765f41e3c045e429c0c496579d4afe07d492ebc36a1a22c45ab29deb4c08b47 -size 394 diff --git a/docs/assets/material-description.svg b/docs/assets/material-description.svg deleted file mode 100644 index bb6df3f92..000000000 --- a/docs/assets/material-description.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c86deb1bb0d4e84112fe56da6584aaf00e1bf64f2b6e2494332a2b77ab0dd153 -size 295 diff --git a/docs/assets/material-toolbox.svg b/docs/assets/material-toolbox.svg deleted file mode 100644 index cd71e6529..000000000 --- a/docs/assets/material-toolbox.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e16ce0bf72dfb113bc116de6422b56d45947112674d4b1f002d1c9205360028 -size 339 From f03acdb1162f123a6f6d299b4931a038d967b4cb Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:52:03 +0200 Subject: [PATCH 09/11] Move all docs assets under assets directory --- .../{ => bibliography}/elsevier-harvard.csl | 0 docs/assets/{ => bibliography}/pydvl.bib | 0 docs/{ => assets}/css/extra.css | 0 docs/{ => assets}/css/grid-cards.css | 0 docs/assets/{ => images}/logo.svg | 0 docs/assets/{ => images}/signet.svg | 0 docs/{javascripts => assets/js}/mathjax.js | 0 docs/{ => assets}/overrides/main.html | 0 .../overrides/partials/copyright.html | 0 .../integrations/analytics/simpleanalytics.html | 0 mkdocs.yml | 16 ++++++++-------- 11 files changed, 8 insertions(+), 8 deletions(-) rename docs/assets/{ => bibliography}/elsevier-harvard.csl (100%) rename docs/assets/{ => bibliography}/pydvl.bib (100%) rename docs/{ => assets}/css/extra.css (100%) rename docs/{ => assets}/css/grid-cards.css (100%) rename docs/assets/{ => images}/logo.svg (100%) rename docs/assets/{ => images}/signet.svg (100%) rename docs/{javascripts => assets/js}/mathjax.js (100%) rename docs/{ => assets}/overrides/main.html (100%) rename docs/{ => assets}/overrides/partials/copyright.html (100%) rename docs/{ => assets}/overrides/partials/integrations/analytics/simpleanalytics.html (100%) diff --git a/docs/assets/elsevier-harvard.csl b/docs/assets/bibliography/elsevier-harvard.csl similarity index 100% rename from docs/assets/elsevier-harvard.csl rename to docs/assets/bibliography/elsevier-harvard.csl diff --git a/docs/assets/pydvl.bib b/docs/assets/bibliography/pydvl.bib similarity index 100% rename from docs/assets/pydvl.bib rename to docs/assets/bibliography/pydvl.bib diff --git a/docs/css/extra.css b/docs/assets/css/extra.css similarity index 100% rename from docs/css/extra.css rename to docs/assets/css/extra.css diff --git a/docs/css/grid-cards.css b/docs/assets/css/grid-cards.css similarity index 100% rename from docs/css/grid-cards.css rename to docs/assets/css/grid-cards.css diff --git a/docs/assets/logo.svg b/docs/assets/images/logo.svg similarity index 100% rename from docs/assets/logo.svg rename to docs/assets/images/logo.svg diff --git a/docs/assets/signet.svg b/docs/assets/images/signet.svg similarity index 100% rename from docs/assets/signet.svg rename to docs/assets/images/signet.svg diff --git a/docs/javascripts/mathjax.js b/docs/assets/js/mathjax.js similarity index 100% rename from docs/javascripts/mathjax.js rename to docs/assets/js/mathjax.js diff --git a/docs/overrides/main.html b/docs/assets/overrides/main.html similarity index 100% rename from docs/overrides/main.html rename to docs/assets/overrides/main.html diff --git a/docs/overrides/partials/copyright.html b/docs/assets/overrides/partials/copyright.html similarity index 100% rename from docs/overrides/partials/copyright.html rename to docs/assets/overrides/partials/copyright.html diff --git a/docs/overrides/partials/integrations/analytics/simpleanalytics.html b/docs/assets/overrides/partials/integrations/analytics/simpleanalytics.html similarity index 100% rename from docs/overrides/partials/integrations/analytics/simpleanalytics.html rename to docs/assets/overrides/partials/integrations/analytics/simpleanalytics.html diff --git a/mkdocs.yml b/mkdocs.yml index 225e952b6..2c5d78027 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -143,8 +143,8 @@ plugins: show_root_full_path: true show_root_heading: true - bibtex: - bib_file: "docs/assets/pydvl.bib" - csl_file: "docs/assets/elsevier-harvard.csl" + bib_file: "docs/assets/bibliography/pydvl.bib" + csl_file: "docs/assets/bibliography/elsevier-harvard.csl" cite_inline: true - git-revision-date-localized: enable_creation_date: true @@ -155,9 +155,9 @@ plugins: theme: name: material - custom_dir: docs/overrides - logo: assets/signet.svg - favicon: assets/signet.svg + custom_dir: docs/assets/overrides + logo: assets/images/signet.svg + favicon: assets/images/signet.svg icon: repo: fontawesome/brands/github features: @@ -199,11 +199,11 @@ theme: name: Switch to system preference extra_css: - - css/extra.css - - css/grid-cards.css + - assets/css/extra.css + - assets/css/grid-cards.css extra_javascript: - - javascripts/mathjax.js + - assets/js/mathjax.js - https://polyfill.io/v3/polyfill.min.js?features=es6 - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js From e4373d0fb3a62e2ec27ad9e9cd2196faf9c15444 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:52:14 +0200 Subject: [PATCH 10/11] Update docs gitignore --- docs/.gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index af230d587..7a3d91071 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -5,6 +5,8 @@ pydvl/* !pydvl/index.rst -# Changelog +# Files copied during documentation build CHANGELOG.md -CONTRIBUTING.md \ No newline at end of file +changelog.md +CONTRIBUTING.md +development_guidelines.md From 0433b9c653a8e6b1d7bd63213fe74c7ce0243bc7 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Thu, 27 Jun 2024 13:58:08 +0200 Subject: [PATCH 11/11] Add manually references to user facing function and class as example --- docs/api/user-api/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/user-api/index.md b/docs/api/user-api/index.md index a50ac966a..6403546f3 100644 --- a/docs/api/user-api/index.md +++ b/docs/api/user-api/index.md @@ -4,3 +4,7 @@ alias: name: user-api title: User API --- + +::: pydvl.value.shapley.montecarlo.permutation_montecarlo_shapley + +::: pydvl.influence.torch.DirectInfluence