Skip to content

Commit

Permalink
docs: prepare for versionning in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashervier committed Jul 18, 2023
1 parent 8fbeaca commit 2a0a985
Show file tree
Hide file tree
Showing 90 changed files with 1,619 additions and 14 deletions.
Empty file added old/.nojekyll
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
1,605 changes: 1,605 additions & 0 deletions old/index.html

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions v1.0.1/api/attributions/api_attributions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ <h2 id="common-api">Common API<a class="headerlink" href="#common-api" title="Pe
</ul>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Please refer to the <a href="https://deel-ai.github.io/xplique/#whats-included">table</a> to see which methods might work with Tabular Data</p>
<p>Please refer to the <a href="https://deel-ai.github.io/xplique/v1.0.1/#whats-included">table</a> to see which methods might work with Tabular Data</p>
</div>
</li>
<li>
Expand Down Expand Up @@ -1099,7 +1099,7 @@ <h2 id="common-api">Common API<a class="headerlink" href="#common-api" title="Pe
<p>Even though we made an harmonized API for all attributions methods it might be relevant for the user to distinguish Gradient based and Perturbation based methods, also often referenced respectively as white-box and black-box methods, as their hyperparameters settings might be quite different.</p>
<h2 id="perturbation-based-approaches">Perturbation-based approaches<a class="headerlink" href="#perturbation-based-approaches" title="Permanent link">&para;</a></h2>
<p>Perturbation based methods focus on perturbing an input with a variety of techniques and, with the analysis of the resulting outputs, define an attribution representation. Therefore, <strong>there is no need to explicitly know the model architecture</strong> as long as forward pass is available, which explain why they are also referenced as black-box methods.</p>
<p>Therefore, to use perturbation-based approaches you do not need a TF model. To know more, please see the <a href="https://deel-ai.github.io/xplique/callable.html">Callable</a> documentation.</p>
<p>Therefore, to use perturbation-based approaches you do not need a TF model. To know more, please see the <a href="https://deel-ai.github.io/xplique/v1.0.1/callable.html">Callable</a> documentation.</p>
<p>Xplique includes the following black-box attributions:</p>
<table>
<thead>
Expand Down
6 changes: 3 additions & 3 deletions v1.0.1/api/metrics/api_metrics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ <h2 id="common-api">Common API<a class="headerlink" href="#common-api" title="Pe
<p>- <code>inputs</code>: Input samples to be explained</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Inputs should be the same as defined in the attribution's <a href="https://deel-ai.github.io/xplique/api/attributions/api_attributions/">API Description</a></p>
<p>Inputs should be the same as defined in the attribution's <a href="https://deel-ai.github.io/xplique/v1.0.1/api/attributions/api_attributions/">API Description</a></p>
</div>
</li>
<li>
Expand All @@ -1007,7 +1007,7 @@ <h3 id="explanationmetric"><code>ExplanationMetric</code><a class="headerlink" h
</div>
<p>All metrics inheriting from this class have another argument in their <code>__init__</code> method:</p>
<ul>
<li>- <code>operator</code>: Optionnal function wrapping the model. It can be seen as a metric which allow to evaluate model evolution. For more details, see the attribution's <a href="https://deel-ai.github.io/xplique/api/attributions/api_attributions/">API Description</a></li>
<li>- <code>operator</code>: Optionnal function wrapping the model. It can be seen as a metric which allow to evaluate model evolution. For more details, see the attribution's <a href="https://deel-ai.github.io/xplique/v1.0.1/api/attributions/api_attributions/">API Description</a></li>
</ul>
<p>All metrics inheriting from this class have to define a method <code>evaluate</code> which will take as input the <code>attributions</code> given by an explainer. Those attributions should correspond to the <code>model</code>, <code>inputs</code> and <code>targets</code> used to build the metric object.</p>
<p>Especially, all Fidelity metrics inherit from this class:</p>
Expand Down Expand Up @@ -1038,7 +1038,7 @@ <h3 id="explainermetric"><code>ExplainerMetric</code><a class="headerlink" href=
<p>All metrics inheriting from this class have to define a method <code>evaluate</code> which will take as input the <code>explainer</code> evaluated.</p>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p>It is even more important that <code>inputs</code> and <code>targets</code> are the same as defined in the attribution's <a href="https://deel-ai.github.io/xplique/api/attributions/api_attributions/">API Description</a></p>
<p>It is even more important that <code>inputs</code> and <code>targets</code> are the same as defined in the attribution's <a href="https://deel-ai.github.io/xplique/v1.0.1/api/attributions/api_attributions/">API Description</a></p>
</div>
<p>Currently, there is only one Stability metric inheriting from this class:</p>
<table>
Expand Down
18 changes: 9 additions & 9 deletions v1.0.1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1073,13 +1073,13 @@ <h1>Home</h1>
<a href="https://deel-ai.github.io/xplique/"><strong>Explore Xplique docs »</strong></a>
<br>
<br>
<a href="https://deel-ai.github.io/xplique/api/attributions/api_attributions/">Attributions</a>
<a href="https://deel-ai.github.io/xplique/v1.0.1/api/attributions/api_attributions/">Attributions</a>
·
<a href="https://deel-ai.github.io/xplique/api/concepts/cav/">Concept</a>
<a href="https://deel-ai.github.io/xplique/v1.0.1/api/concepts/cav/">Concept</a>
·
<a href="https://deel-ai.github.io/xplique/api/feature_viz/feature_viz/">Feature Visualization</a>
<a href="https://deel-ai.github.io/xplique/v1.0.1/api/feature_viz/feature_viz/">Feature Visualization</a>
·
<a href="https://deel-ai.github.io/xplique/api/metrics/api_metrics/">Metrics</a>
<a href="https://deel-ai.github.io/xplique/v1.0.1/api/metrics/api_metrics/">Metrics</a>
</p>

<p>The library is composed of several modules, the <em>Attributions Methods</em> module implements various methods (e.g Saliency, Grad-CAM, Integrated-Gradients...), with explanations, examples and links to official papers.
Expand Down Expand Up @@ -1163,7 +1163,7 @@ <h3 id="attributions-methods">Attributions Methods<a class="headerlink" href="#a
<span class="n">explanations</span> <span class="o">=</span> <span class="n">explainer</span><span class="o">.</span><span class="n">explain</span><span class="p">(</span><span class="n">images</span><span class="p">,</span> <span class="n">labels</span><span class="p">)</span>
<span class="c1"># or just `explainer(images, labels)`</span>
</code></pre></div>
<p>All attributions methods share a common API. You can find out more about it <a href="https://deel-ai.github.io/xplique/api/attributions/api_attributions/">here</a>.</p>
<p>All attributions methods share a common API. You can find out more about it <a href="https://deel-ai.github.io/xplique/v1.0.1/api/attributions/api_attributions/">here</a>.</p>
<h3 id="attributions-metrics">Attributions Metrics<a class="headerlink" href="#attributions-metrics" title="Permanent link">&para;</a></h3>
<p>In order to measure if the explanations provided by our method are faithful (it reflects well the functioning of the model) we can use a fidelity metric such as Deletion</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">xplique.attributions</span> <span class="kn">import</span> <span class="n">GradCAM</span>
Expand All @@ -1178,7 +1178,7 @@ <h3 id="attributions-metrics">Attributions Metrics<a class="headerlink" href="#a

<span class="n">score_grad_cam</span> <span class="o">=</span> <span class="n">metric</span><span class="p">(</span><span class="n">explanations</span><span class="p">)</span>
</code></pre></div>
<p>All attributions metrics share a common API. You can find out more about it <a href="https://deel-ai.github.io/xplique/api/metrics/api_metrics/">here</a></p>
<p>All attributions metrics share a common API. You can find out more about it <a href="https://deel-ai.github.io/xplique/v1.0.1/api/metrics/api_metrics/">here</a></p>
<h3 id="concepts-extraction">Concepts Extraction<a class="headerlink" href="#concepts-extraction" title="Permanent link">&para;</a></h3>
<p>Concerning the concept-based methods, we can for example extract a concept vector from a layer of a model. In order to do this, we use two datasets, one containing inputs containing the concept: <code>positive_samples</code>, the other containing other entries which do not contain the concept: <code>negative_samples</code>.</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">xplique.concepts</span> <span class="kn">import</span> <span class="n">Cav</span>
Expand All @@ -1191,7 +1191,7 @@ <h3 id="concepts-extraction">Concepts Extraction<a class="headerlink" href="#con
<span class="n">concept_vector</span> <span class="o">=</span> <span class="n">extractor</span><span class="p">(</span><span class="n">positive_samples</span><span class="p">,</span>
<span class="n">negative_samples</span><span class="p">)</span>
</code></pre></div>
<p>More information on CAV <a href="https://deel-ai.github.io/xplique/api/concepts/cav/">here</a> and on TCAV <a href="https://deel-ai.github.io/xplique/api/concepts/tcav/">here</a>.</p>
<p>More information on CAV <a href="https://deel-ai.github.io/xplique/v1.0.1/api/concepts/cav/">here</a> and on TCAV <a href="https://deel-ai.github.io/xplique/v1.0.1/api/concepts/tcav/">here</a>.</p>
<h3 id="feature-visualization">Feature Visualization<a class="headerlink" href="#feature-visualization" title="Permanent link">&para;</a></h3>
<p>Finally, in order to find an image that maximizes a neuron and at the same time a layer, we build two objectives that we combine together. We then call the optimizer which returns our images</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">xplique.features_visualizations</span> <span class="kn">import</span> <span class="n">Objective</span>
Expand All @@ -1205,7 +1205,7 @@ <h3 id="feature-visualization">Feature Visualization<a class="headerlink" href="
<span class="n">obj</span> <span class="o">=</span> <span class="n">neuron_obj</span> <span class="o">+</span> <span class="mf">2.0</span> <span class="o">*</span> <span class="n">channel_obj</span>
<span class="n">images</span><span class="p">,</span> <span class="n">obj_names</span> <span class="o">=</span> <span class="n">optimize</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
</code></pre></div>
<p>Want to know more ? Check the Feature Viz <a href="https://deel-ai.github.io/xplique/api/feature_viz/feature_viz/">documentation</a></p>
<p>Want to know more ? Check the Feature Viz <a href="https://deel-ai.github.io/xplique/v1.0.1/api/feature_viz/feature_viz/">documentation</a></p>
<h2 id="whats-included">📦 What's Included<a class="headerlink" href="#whats-included" title="Permanent link">&para;</a></h2>
<p>All the attributions method presented below handle both <strong>Classification</strong> and <strong>Regression</strong> tasks.</p>
<table>
Expand Down Expand Up @@ -1368,7 +1368,7 @@ <h2 id="whats-included">📦 What's Included<a class="headerlink" href="#whats-i
</tbody>
</table>
<ul>
<li>: See the <a href="https://deel-ai.github.io/xplique/callable/">Callable documentation</a></li>
<li>: See the <a href="https://deel-ai.github.io/xplique/v1.0.1/callable/">Callable documentation</a></li>
</ul>
<table>
<thead>
Expand Down

0 comments on commit 2a0a985

Please sign in to comment.