-
Notifications
You must be signed in to change notification settings - Fork 2
/
installation.html
197 lines (168 loc) · 9.06 KB
/
installation.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Installation — pystruct 0.2.4 documentation</title>
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/gallery.css" type="text/css" />
<link rel="stylesheet" href="_static/pystruct.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="_static/bootswatch-3.3.4/cerulean/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.2.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
<link rel="top" title="pystruct 0.2.4 documentation" href="index.html" />
<link rel="next" title="User Guide" href="user_guide.html" />
<link rel="prev" title="What is structured learning?" href="intro.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
</head>
<body role="document">
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
PyStruct</a>
<span class="navbar-text navbar-version pull-left"><b>0.2.4</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Start</a></li>
<li><a href="#">Installation</a></li>
<li><a href="intro.html">Introduction</a></li>
<li><a href="user_guide.html">User Guide</a></li>
<li><a href="auto_examples/index.html">Examples</a></li>
<li><a href="references.html">API</a></li>
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"></ul>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container content-container">
<div class="section" id="installation">
<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<p>To install pystruct, you need cvxopt, cython and scikit-learn (which requires numpy and scipy).</p>
<p>The easiest way to install pystruct is using pip:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install pystruct
</pre></div>
</div>
<p>This will also install the additional inference package ad3.</p>
<p>Installation instructions for the requirements are below.</p>
<div class="section" id="linux-ubuntu">
<h2>Linux (Ubuntu)<a class="headerlink" href="#linux-ubuntu" title="Permalink to this headline">¶</a></h2>
<p>The easiest way to get all requirements is via the package manager, that is apt on Ubuntu and Debian:</p>
<div class="highlight-python"><div class="highlight"><pre>sudo apt-get install build-essential python-dev python-setuptools python-numpy \\
python-scipy libatlas-dev libatlas3gf-base python-cvxopt
</pre></div>
</div>
<p>To install the current versions of scikit-learn and pystruct, you can use pip:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install --user --upgrade scikit-learn pystruct
</pre></div>
</div>
</div>
<div class="section" id="os-x-windows">
<h2>OS X & Windows<a class="headerlink" href="#os-x-windows" title="Permalink to this headline">¶</a></h2>
<p>Follow instructions on the <a class="reference external" href="http://scikit-learn.org/dev/install.html">scikit-learn website</a> and
then <a class="reference external" href="http://cvxopt.org/install/">install CVXOPT</a>.
Finally, you can install pystruct simply using:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install --user --upgrade pystruct
</pre></div>
</div>
</div>
<div class="section" id="alternative-anaconda">
<h2>Alternative: Anaconda<a class="headerlink" href="#alternative-anaconda" title="Permalink to this headline">¶</a></h2>
<p>In particular for OS X and Windows, an alternative is to use the <a class="reference external" href="https://store.continuum.io/cshop/anaconda/">Anaconda Python</a> distribution.
The anaconda environment comes with its own Python and a package manager named conda.
You can install cvxopt using the conda package manager:</p>
<div class="highlight-python"><div class="highlight"><pre>conda install cvxopt
</pre></div>
</div>
<p>And then install pystruct:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install --user --upgrade pystruct
</pre></div>
</div>
</div>
</div>
<div class="section" id="additional-inference-packages">
<h1>Additional inference packages<a class="headerlink" href="#additional-inference-packages" title="Permalink to this headline">¶</a></h1>
<p>While PyStruct implements some simple inference algorithms, these are not as optimized as other available code.
Therefore it is recommended to install additional inference packages.
By default PyStruct will also install the AD3 package, which contains a high-quality solver
that can be chosen via <code class="docutils literal"><span class="pre">inference_method='ad3'</span></code>.
Another solver that is helpful for highly connected graphs like grid-graphs is QPBO, which
can be installed via the pyqpbo package:</p>
<div class="highlight-python"><div class="highlight"><pre>pip install --user pyqpbo
</pre></div>
</div>
<p>Unfortunately QPBO might not compile with newer C compilers, so we decided to not make it a dependency.</p>
<p>There is a very high quality collection of inference algorithms in
the <a class="reference external" href="http://ipa.iwr.uni-heidelberg.de/jkappes/opengm2/">OpenGM</a> library, which
is highly recommended. The algorithms in OpenGM can be chosen by specifying
<code class="docutils literal"><span class="pre">inference_algorithm=('ogm',</span> <span class="pre">{'alg':</span> <span class="pre">ALGORITHM})</span></code> where ALGORITHM can be a
wide variety of algorithms, including dynamic programming, TRWS, graph cuts and
many more, see <a class="reference internal" href="generated/pystruct.inference.inference_ogm.html#pystruct.inference.inference_ogm" title="pystruct.inference.inference_ogm"><code class="xref py py-func docutils literal"><span class="pre">inference_ogm()</span></code></a>.</p>
<p>In particular for tree-structured (not chain) models, the implementation of dynamic
programming max-product belief propagation in OpenGM is much faster than the
one in PyStruct.</p>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43292385-1', 'pystruct.github.io');
ga('send', 'pageview');
</script>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
© Copyright 2013, Andreas Mueller.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.<br/>
</p>
</div>
</footer>
</body>
</html>