/
index.html
31 lines (28 loc) · 10.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · MIPVerify</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>MIPVerify</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search/"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li class="current"><a class="toctext" href>Home</a><ul class="internal"><li><a class="toctext" href="#Installation-1">Installation</a></li><li><a class="toctext" href="#Getting-Started-1">Getting Started</a></li></ul></li><li><a class="toctext" href="tutorials/">Tutorials</a></li><li><span class="toctext">Finding Adversarial Examples</span><ul><li><a class="toctext" href="finding_adversarial_examples/single_image/">Single Image</a></li><li><a class="toctext" href="finding_adversarial_examples/batch_processing/">Batch Processing</a></li></ul></li><li><span class="toctext">Importing</span><ul><li><a class="toctext" href="utils/import_example_nets/">Example Neural Networks</a></li><li><a class="toctext" href="utils/import_weights/">Helpers for importing individual layers</a></li><li><a class="toctext" href="utils/import_datasets/">Datasets</a></li></ul></li><li><span class="toctext">Working with Neural Net Parameters</span><ul><li><a class="toctext" href="net_components/overview/">Overview</a></li><li><a class="toctext" href="net_components/layers/">Layers</a></li><li><a class="toctext" href="net_components/nets/">Networks</a></li><li><a class="toctext" href="net_components/core_ops/">Core Operations</a></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li><a href>Home</a></li></ul><a class="edit-page" href="https://github.com/vtjeng/MIPVerify.jl/blob/master/docs/src/index.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Home</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="MIPVerify-1" href="#MIPVerify-1">MIPVerify</a></h1><p><code>MIPVerify.jl</code> enables users to verify neural networks that are piecewise affine by: 1) finding the closest adversarial example to a selected input, or 2) proving that no adversarial example exists for some bounded family of perturbations.</p><h2><a class="nav-anchor" id="Installation-1" href="#Installation-1">Installation</a></h2><h3><a class="nav-anchor" id="Prerequisites-1" href="#Prerequisites-1">Prerequisites</a></h3><p>To use our package, you require</p><ol><li>The Julia programming language</li><li>An optimization solver <a href="http://www.juliaopt.org/JuMP.jl/0.18/installation.html#getting-solvers">supported</a> by <code>JuMP</code></li><li>The Julia package for working with that solver</li></ol><p>Our choice of solver is <a href="http://www.gurobi.com/">Gurobi</a>, but any supported optimization solver will work.</p><p><strong>Platform compatibility:</strong> Julia and Gurobi are available for 32-bit and 64-bit Windows, 64-bit macOS, and 64-bit Linux, but example code in this README is for Linux.</p><h4><a class="nav-anchor" id="Installing-Julia-1" href="#Installing-Julia-1">Installing Julia</a></h4><p>The latest release of this package requires <a href="https://julialang.org/downloads/">version 1.0</a> or above of Julia.</p><p>Platform-specific instructions can be found <a href="https://julialang.org/downloads/platform.html">here</a>. To complete your installation, ensure that you are able to call <code>julia</code> REPL from the command line.</p><div class="admonition warning"><div class="admonition-title">Warning</div><div class="admonition-text"><p>Do <strong>not</strong> use <code>apt-get</code> or <code>brew</code> to install Julia, as the versions provided by these package managers tend to be out of date.</p></div></div><h5><a class="nav-anchor" id="On-Ubuntu-1" href="#On-Ubuntu-1">On Ubuntu</a></h5><pre><code class="language-console">$ cd /your/path/here
wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.4-linux-x86_64.tar.gz
tar -xvf julia-1.0.4-linux-x86_64.tar.gz</code></pre><p>Julia will be extracted to a folder named <code>julia-semantic_version</code>. (For example, <code>julia-1.0.4</code>). </p><p>Add the following lines to your startup file (e.g. <code>.bashrc</code> for the bash shell) to add Julia's bin folder to your system <code>PATH</code> environment variable.</p><pre><code class="language-sh">export PATH="${PATH}:/your/path/here/julia-1.0.4/bin"</code></pre><h4><a class="nav-anchor" id="Installing-Gurobi-1" href="#Installing-Gurobi-1">Installing Gurobi</a></h4><p>Download the most recent version of the <a href="http://www.gurobi.com/downloads/gurobi-optimizer">Gurobi optimizer</a>. A license is required to use Gurobi; free academic licenses are <a href="https://user.gurobi.com/download/licenses/free-academic">available</a>.</p><h5><a class="nav-anchor" id="On-Ubuntu-2" href="#On-Ubuntu-2">On Ubuntu</a></h5><pre><code class="language-console">$ cd /your/path/here
wget https://packages.gurobi.com/8.0/gurobi8.0.1_linux64.tar.gz
tar -xvf gurobi8.0.1_linux64.tar.gz</code></pre><p>Add the following environment variables to your startup file</p><pre><code class="language-sh">export GUROBI_HOME="/your/path/here/gurobi801/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"</code></pre><p>Finally, install the license obtained on a terminal prompt</p><pre><code class="language-console">$ grbgetkey aaaa0000-0000-0000-0000-000000000000</code></pre><div class="admonition note"><div class="admonition-title">Note</div><div class="admonition-text"><p>You will have to obtain your own license number from the Gurobi site.</p></div></div><pre><code class="language-sh">Sample output:
info : grbgetkey version 8.0.1, build v8.0.1rc0
info : Contacting Gurobi key server...
info : Key for license ID 000000 was successfully retrieved
info : License expires at the end of the day on 2019-09-30
info : Saving license key...
In which directory would you like to store the Gurobi license key file?
[hit Enter to store it in /home/ubuntu]:
info : License 000000 written to file /home/ubuntu/gurobi.lic</code></pre><div class="admonition note"><div class="admonition-title">Note</div><div class="admonition-text"><p>If you store the license file in a non-default location, you will have to add the environment variable <code>GRB_LICENSE_FILE</code> to your startup file: <code>export GRB_LICENSE_FILE="/your/path/here/gurobi.lic"</code></p></div></div><h4><a class="nav-anchor" id="Installing-Gurobi.jl-1" href="#Installing-Gurobi.jl-1">Installing <code>Gurobi.jl</code></a></h4><p><code>Gurobi.jl</code> is a wrapper of the Gurobi solver accessible in Julia. Once you have installed Gurobi <em>and</em> activated the license, install the latest release of <code>Gurobi.jl</code>:</p><pre><code class="language-julia">julia> using Pkg; Pkg.add("Gurobi")</code></pre><p>You can test <code>Gurobi.jl</code> by running</p><pre><code class="language-julia">julia> using Pkg; Pkg.test("Gurobi")</code></pre><p>Sample output:</p><pre><code class="language-sh">INFO: Testing Gurobi
Academic license - for non-commercial use only
...
Test Summary: | Pass Total
C API | 19 19
...
Test Summary: | Pass Total
MathOptInterface Tests | 1415 1415
INFO: Gurobi tests passed</code></pre><h3><a class="nav-anchor" id="Installing-MIPVerify-1" href="#Installing-MIPVerify-1">Installing <code>MIPVerify</code></a></h3><p>Once you have Julia and Gurobi installed, install the latest release of MIPVerify:</p><pre><code class="language-julia">julia> using Pkg; Pkg.add("MIPVerify")</code></pre><p>You can test <code>MIPVerify</code> by running</p><pre><code class="language-julia">julia> using Pkg; Pkg.test("MIPVerify")</code></pre><p>These tests do take a long time to run (~30 mins), but any issues generally cause early failures.</p><h3><a class="nav-anchor" id="Troubleshooting-your-installation-1" href="#Troubleshooting-your-installation-1">Troubleshooting your installation</a></h3><h4><a class="nav-anchor" id="Invalid-Gurobi-License-1" href="#Invalid-Gurobi-License-1">Invalid Gurobi License</a></h4><p>When running <code>Pkg.test("Gurobi")</code>:</p><pre><code class="language-sh">INFO: Testing Gurobi
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><a class="nav-anchor" id="Getting-Started-1" href="#Getting-Started-1">Getting Started</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're done with that, you can explore our other tutorials depending on your needs.</p><footer><hr/><a class="next" href="tutorials/"><span class="direction">Next</span><span class="title">Tutorials</span></a></footer></article></body></html>