Skip to content

Commit

Permalink
build based on e5e908f
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 16, 2023
1 parent 9773258 commit f5e5bb6
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions dev/finding_adversarial_examples/batch_processing/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/finding_adversarial_examples/single_image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
tightening_options,
solve_if_predicted_in_targeted
)
</code></pre><p>Finds the perturbed image closest to <code>input</code> such that the network described by <code>nn</code> classifies the perturbed image in one of the categories identified by the indexes in <code>target_selection</code>.</p><p><code>optimizer</code> specifies the optimizer used to solve the MIP problem once it has been built.</p><p>The output dictionary has keys <code>:Model, :PerturbationFamily, :TargetIndexes, :SolveStatus, :Perturbation, :PerturbedInput, :Output</code>. See the <a href="https://nbviewer.jupyter.org/github/vtjeng/MIPVerify.jl/blob/master/examples/03_interpreting_the_output_of_find_adversarial_example.ipynb">tutorial</a> on what individual dictionary entries correspond to.</p><p><em>Formal Definition</em>: If there are a total of <code>n</code> categories, the (perturbed) output vector <code>y=d[:Output]=d[:PerturbedInput] |&gt; nn</code> has length <code>n</code>. We guarantee that <code>y[j] - y[i] ≥ 0</code> for some <code>j ∈ target_selection</code> and for all <code>i ∉ target_selection</code>.</p><p><strong>Named Arguments:</strong></p><ul><li><code>invert_target_selection::Bool</code>: Defaults to <code>false</code>. If <code>true</code>, sets <code>target_selection</code> to be its complement.</li><li><code>pp::PerturbationFamily</code>: Defaults to <code>UnrestrictedPerturbationFamily()</code>. Determines the family of perturbations over which we are searching for adversarial examples.</li><li><code>norm_order::Real</code>: Defaults to <code>1</code>. Determines the distance norm used to determine the distance from the perturbed image to the original. Supported options are <code>1</code>, <code>Inf</code> and <code>2</code> (if the <code>optimizer</code> used can solve MIQPs.)</li><li><code>tightening_algorithm::MIPVerify.TighteningAlgorithm</code>: Defaults to <code>mip</code>. Determines how we determine the upper and lower bounds on input to each nonlinear unit. Allowed options are <code>interval_arithmetic</code>, <code>lp</code>, <code>mip</code>. (1) <code>interval_arithmetic</code> looks at the bounds on the output to the previous layer. (2) <code>lp</code> solves an <code>lp</code> corresponding to the <code>mip</code> formulation, but with any integer constraints relaxed. (3) <code>mip</code> solves the full <code>mip</code> formulation.</li><li><code>tightening_options</code>: Solver-specific options passed to optimizer when used to determine upper and lower bounds for input to nonlinear units. Note that these are only used if the <code>tightening_algorithm</code> is <code>lp</code> or <code>mip</code> (no solver is used when <code>interval_arithmetic</code> is used to compute the bounds). Defaults for Gurobi and HiGHS to a time limit of 20s per solve, with output suppressed.</li><li><code>solve_if_predicted_in_targeted</code>: Defaults to <code>true</code>. The prediction that <code>nn</code> makes for the unperturbed <code>input</code> can be determined efficiently. If the predicted index is one of the indexes in <code>target_selection</code>, we can skip the relatively costly process of building the model for the MIP problem since we already have an &quot;adversarial example&quot; –- namely, the input itself. We continue build the model and solve the (trivial) MIP problem if and only if <code>solve_if_predicted_in_targeted</code> is <code>true</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/vtjeng/MIPVerify.jl/blob/b0ebe49536656bc416544d032d8f3e7eee436d97/src/MIPVerify.jl#L42">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="MIPVerify.frac_correct-Tuple{NeuralNet, MIPVerify.LabelledDataset, Integer}" href="#MIPVerify.frac_correct-Tuple{NeuralNet, MIPVerify.LabelledDataset, Integer}"><code>MIPVerify.frac_correct</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">frac_correct(nn, dataset, num_samples)
</code></pre><p>Returns the fraction of items the neural network correctly classifies of the first <code>num_samples</code> of the provided <code>dataset</code>. If there are fewer than <code>num_samples</code> items, we use all of the available samples.</p><p><strong>Named Arguments:</strong></p><ul><li><code>nn::NeuralNet</code>: The parameters of the neural network.</li><li><code>dataset::LabelledDataset</code>:</li><li><code>num_samples::Integer</code>: Number of samples to use.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/vtjeng/MIPVerify.jl/blob/b0ebe49536656bc416544d032d8f3e7eee436d97/src/MIPVerify.jl#L171">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tutorials/">« Tutorials</a><a class="docs-footer-nextpage" href="../batch_processing/">Batch Processing »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 25 October 2023 03:25">Wednesday 25 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
</code></pre><p>Finds the perturbed image closest to <code>input</code> such that the network described by <code>nn</code> classifies the perturbed image in one of the categories identified by the indexes in <code>target_selection</code>.</p><p><code>optimizer</code> specifies the optimizer used to solve the MIP problem once it has been built.</p><p>The output dictionary has keys <code>:Model, :PerturbationFamily, :TargetIndexes, :SolveStatus, :Perturbation, :PerturbedInput, :Output</code>. See the <a href="https://nbviewer.jupyter.org/github/vtjeng/MIPVerify.jl/blob/master/examples/03_interpreting_the_output_of_find_adversarial_example.ipynb">tutorial</a> on what individual dictionary entries correspond to.</p><p><em>Formal Definition</em>: If there are a total of <code>n</code> categories, the (perturbed) output vector <code>y=d[:Output]=d[:PerturbedInput] |&gt; nn</code> has length <code>n</code>. We guarantee that <code>y[j] - y[i] ≥ 0</code> for some <code>j ∈ target_selection</code> and for all <code>i ∉ target_selection</code>.</p><p><strong>Named Arguments:</strong></p><ul><li><code>invert_target_selection::Bool</code>: Defaults to <code>false</code>. If <code>true</code>, sets <code>target_selection</code> to be its complement.</li><li><code>pp::PerturbationFamily</code>: Defaults to <code>UnrestrictedPerturbationFamily()</code>. Determines the family of perturbations over which we are searching for adversarial examples.</li><li><code>norm_order::Real</code>: Defaults to <code>1</code>. Determines the distance norm used to determine the distance from the perturbed image to the original. Supported options are <code>1</code>, <code>Inf</code> and <code>2</code> (if the <code>optimizer</code> used can solve MIQPs.)</li><li><code>tightening_algorithm::MIPVerify.TighteningAlgorithm</code>: Defaults to <code>mip</code>. Determines how we determine the upper and lower bounds on input to each nonlinear unit. Allowed options are <code>interval_arithmetic</code>, <code>lp</code>, <code>mip</code>. (1) <code>interval_arithmetic</code> looks at the bounds on the output to the previous layer. (2) <code>lp</code> solves an <code>lp</code> corresponding to the <code>mip</code> formulation, but with any integer constraints relaxed. (3) <code>mip</code> solves the full <code>mip</code> formulation.</li><li><code>tightening_options</code>: Solver-specific options passed to optimizer when used to determine upper and lower bounds for input to nonlinear units. Note that these are only used if the <code>tightening_algorithm</code> is <code>lp</code> or <code>mip</code> (no solver is used when <code>interval_arithmetic</code> is used to compute the bounds). Defaults for Gurobi and HiGHS to a time limit of 20s per solve, with output suppressed.</li><li><code>solve_if_predicted_in_targeted</code>: Defaults to <code>true</code>. The prediction that <code>nn</code> makes for the unperturbed <code>input</code> can be determined efficiently. If the predicted index is one of the indexes in <code>target_selection</code>, we can skip the relatively costly process of building the model for the MIP problem since we already have an &quot;adversarial example&quot; –- namely, the input itself. We continue build the model and solve the (trivial) MIP problem if and only if <code>solve_if_predicted_in_targeted</code> is <code>true</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/vtjeng/MIPVerify.jl/blob/e5e908f27c777688d450ab82726c510adac796ea/src/MIPVerify.jl#L42">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="MIPVerify.frac_correct-Tuple{NeuralNet, MIPVerify.LabelledDataset, Integer}" href="#MIPVerify.frac_correct-Tuple{NeuralNet, MIPVerify.LabelledDataset, Integer}"><code>MIPVerify.frac_correct</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">frac_correct(nn, dataset, num_samples)
</code></pre><p>Returns the fraction of items the neural network correctly classifies of the first <code>num_samples</code> of the provided <code>dataset</code>. If there are fewer than <code>num_samples</code> items, we use all of the available samples.</p><p><strong>Named Arguments:</strong></p><ul><li><code>nn::NeuralNet</code>: The parameters of the neural network.</li><li><code>dataset::LabelledDataset</code>:</li><li><code>num_samples::Integer</code>: Number of samples to use.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/vtjeng/MIPVerify.jl/blob/e5e908f27c777688d450ab82726c510adac796ea/src/MIPVerify.jl#L171">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tutorials/">« Tutorials</a><a class="docs-footer-nextpage" href="../batch_processing/">Batch Processing »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Saturday 16 December 2023 02:46">Saturday 16 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
No variables, no constraints: Error During Test
Got an exception of type ErrorException outside of a @test
Invalid Gurobi license
...</code></pre><p><strong>FIX:</strong> The error message indicates that you have not installed your Gurobi license. If it has been installed, the license is saved as a file <code>gurobi.lic</code>, typically in either the <code>/home/ubuntu</code> or <code>opt/gurobi</code> directories.</p><h2 id="Getting-Started"><a class="docs-heading-anchor" href="#Getting-Started">Getting Started</a><a id="Getting-Started-1"></a><a class="docs-heading-anchor-permalink" href="#Getting-Started" title="Permalink"></a></h2><p>The best way to get started is to follow our <a href="https://nbviewer.jupyter.org/github/vtjeng/MIPVerify.jl/blob/master/examples/00_quickstart.ipynb">quickstart tutorial</a>, which demonstrates how to find adversarial examples for a pre-trained example network on the MNIST dataset. Once you&#39;re done with that, you can explore our other tutorials depending on your needs.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="tutorials/">Tutorials »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 25 October 2023 03:25">Wednesday 25 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
...</code></pre><p><strong>FIX:</strong> The error message indicates that you have not installed your Gurobi license. If it has been installed, the license is saved as a file <code>gurobi.lic</code>, typically in either the <code>/home/ubuntu</code> or <code>opt/gurobi</code> directories.</p><h2 id="Getting-Started"><a class="docs-heading-anchor" href="#Getting-Started">Getting Started</a><a id="Getting-Started-1"></a><a class="docs-heading-anchor-permalink" href="#Getting-Started" title="Permalink"></a></h2><p>The best way to get started is to follow our <a href="https://nbviewer.jupyter.org/github/vtjeng/MIPVerify.jl/blob/master/examples/00_quickstart.ipynb">quickstart tutorial</a>, which demonstrates how to find adversarial examples for a pre-trained example network on the MNIST dataset. Once you&#39;re done with that, you can explore our other tutorials depending on your needs.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="tutorials/">Tutorials »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Saturday 16 December 2023 02:46">Saturday 16 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit f5e5bb6

Please sign in to comment.