-
Notifications
You must be signed in to change notification settings - Fork 2
/
references.html
299 lines (270 loc) · 17.7 KB
/
references.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Learning — 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="pystruct.learners.OneSlackSSVM" href="generated/pystruct.learners.OneSlackSSVM.html" />
<link rel="prev" title="SVM as CRF" href="auto_examples/svm_as_crf.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.html">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="#">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="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<div class="section" id="learning">
<span id="id1"></span><h1>Learning<a class="headerlink" href="#learning" title="Permalink to this headline">¶</a></h1>
<p>This module contains algorithms for solving the structured learning model.
Most are based on structured support vector machines.</p>
<p>Currently, I advise to use the OneSlackSSVM, which solves the QP using CVXOPT.
SubgradientSSVM is a very simple implementation, that also might be interesting.</p>
<p>NSlackSSVM is the n-slack formulation of the QP and should work reliably,
but is not as optimized as OneSlackSSVM.
The rest is experimental / for testing.</p>
<span class="target" id="module-pystruct.learners"></span><table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.learners.OneSlackSSVM.html#pystruct.learners.OneSlackSSVM" title="pystruct.learners.OneSlackSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.OneSlackSSVM</span></code></a>(model[, max_iter, C, ...])</td>
<td>Structured SVM solver for the 1-slack QP with l1 slack penalty.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.learners.NSlackSSVM.html#pystruct.learners.NSlackSSVM" title="pystruct.learners.NSlackSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.NSlackSSVM</span></code></a>(model[, max_iter, C, ...])</td>
<td>Structured SVM solver for the n-slack QP with l1 slack penalty.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.learners.SubgradientSSVM.html#pystruct.learners.SubgradientSSVM" title="pystruct.learners.SubgradientSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.SubgradientSSVM</span></code></a>(model[, max_iter, ...])</td>
<td>Structured SVM solver using subgradient descent.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.learners.StructuredPerceptron.html#pystruct.learners.StructuredPerceptron" title="pystruct.learners.StructuredPerceptron"><code class="xref py py-obj docutils literal"><span class="pre">learners.StructuredPerceptron</span></code></a>(model[, ...])</td>
<td>Structured Perceptron training.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.learners.LatentSSVM.html#pystruct.learners.LatentSSVM" title="pystruct.learners.LatentSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.LatentSSVM</span></code></a>(base_ssvm[, ...])</td>
<td>Stuctured SVM solver for latent-variable models.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.learners.SubgradientLatentSSVM.html#pystruct.learners.SubgradientLatentSSVM" title="pystruct.learners.SubgradientLatentSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.SubgradientLatentSSVM</span></code></a>(model[, ...])</td>
<td>Latent Variable Structured SVM solver using subgradient descent.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.learners.PrimalDSStructuredSVM.html#pystruct.learners.PrimalDSStructuredSVM" title="pystruct.learners.PrimalDSStructuredSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.PrimalDSStructuredSVM</span></code></a>(model[, ...])</td>
<td>Uses downhill simplex for optimizing an unconstraint primal.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.learners.FrankWolfeSSVM.html#pystruct.learners.FrankWolfeSSVM" title="pystruct.learners.FrankWolfeSSVM"><code class="xref py py-obj docutils literal"><span class="pre">learners.FrankWolfeSSVM</span></code></a>(model[, max_iter, ...])</td>
<td>Structured SVM solver using Block-coordinate Frank-Wolfe.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="models">
<span id="id2"></span><h1>Models<a class="headerlink" href="#models" title="Permalink to this headline">¶</a></h1>
<p>This module contains model formulations for several settings. They provide the
glue between the learning algorithm and the data (and inference).</p>
<p>There are two main classes of models, conditional random field models (CRFs)
and classification models (Clfs).</p>
<p>The BinaryClf implements a standard binary classifier, the MultiClassClf a
linear multi-class classifier. Together with a max-margin learner, these
produce standard binary SVMs and Crammer-Singer multi-class SVMs. MultiLabelClf
implements a multi label model with different possible pairwise interactions.</p>
<p>GraphCRF implements a simple pairwise model for arbitrary graphs, while
EdgeFeatureGraphCRF allows for arbitrary features for each edge, symmetric,
assymmetric and arbitrary potentials.</p>
<p>GridCRF is a convenience class for grid graphs.</p>
<span class="target" id="module-pystruct.models"></span><div class="section" id="classifiers">
<h2>Classifiers<a class="headerlink" href="#classifiers" title="Permalink to this headline">¶</a></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.BinaryClf.html#pystruct.models.BinaryClf" title="pystruct.models.BinaryClf"><code class="xref py py-obj docutils literal"><span class="pre">models.BinaryClf</span></code></a>([n_features])</td>
<td>Formulate standard linear binary SVM in CRF framework.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.models.MultiClassClf.html#pystruct.models.MultiClassClf" title="pystruct.models.MultiClassClf"><code class="xref py py-obj docutils literal"><span class="pre">models.MultiClassClf</span></code></a>([n_features, ...])</td>
<td>Formulate linear multiclass SVM in C-S style in CRF framework.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.MultiLabelClf.html#pystruct.models.MultiLabelClf" title="pystruct.models.MultiLabelClf"><code class="xref py py-obj docutils literal"><span class="pre">models.MultiLabelClf</span></code></a>([n_labels, n_features, ...])</td>
<td>Multi-label model for predicting several binary classes.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="conditional-random-fields">
<h2>Conditional Random Fields<a class="headerlink" href="#conditional-random-fields" title="Permalink to this headline">¶</a></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.GraphCRF.html#pystruct.models.GraphCRF" title="pystruct.models.GraphCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.GraphCRF</span></code></a>([n_states, n_features, ...])</td>
<td>Pairwise CRF on a general graph.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.models.EdgeFeatureGraphCRF.html#pystruct.models.EdgeFeatureGraphCRF" title="pystruct.models.EdgeFeatureGraphCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.EdgeFeatureGraphCRF</span></code></a>([n_states, ...])</td>
<td>Pairwise CRF with features/strength associated to each edge.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.LatentGraphCRF.html#pystruct.models.LatentGraphCRF" title="pystruct.models.LatentGraphCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.LatentGraphCRF</span></code></a>([n_labels, ...])</td>
<td>CRF with latent states for variables.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.models.LatentNodeCRF.html#pystruct.models.LatentNodeCRF" title="pystruct.models.LatentNodeCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.LatentNodeCRF</span></code></a>([n_labels, n_features, ...])</td>
<td>CRF with latent variables.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.ChainCRF.html#pystruct.models.ChainCRF" title="pystruct.models.ChainCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.ChainCRF</span></code></a>([n_states, n_features, ...])</td>
<td>Linear-chain CRF.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.models.GridCRF.html#pystruct.models.GridCRF" title="pystruct.models.GridCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.GridCRF</span></code></a>([n_states, n_features, ...])</td>
<td>Pairwise CRF on a 2d grid.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.models.DirectionalGridCRF.html#pystruct.models.DirectionalGridCRF" title="pystruct.models.DirectionalGridCRF"><code class="xref py py-obj docutils literal"><span class="pre">models.DirectionalGridCRF</span></code></a>([n_states, ...])</td>
<td>CRF in which each direction of edges has their own set of parameters.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="inference">
<span id="id3"></span><h1>Inference<a class="headerlink" href="#inference" title="Permalink to this headline">¶</a></h1>
<span class="target" id="module-pystruct.inference"></span><table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.inference.inference_dispatch.html#pystruct.inference.inference_dispatch" title="pystruct.inference.inference_dispatch"><code class="xref py py-obj docutils literal"><span class="pre">inference.inference_dispatch</span></code></a>(...[, ...])</td>
<td>Computes the maximizing assignment of a pairwise discrete energy function.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.inference.inference_qpbo.html#pystruct.inference.inference_qpbo" title="pystruct.inference.inference_qpbo"><code class="xref py py-obj docutils literal"><span class="pre">inference.inference_qpbo</span></code></a>(unary_potentials, ...)</td>
<td>Inference with PyQPBO backend.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.inference.inference_lp.html#pystruct.inference.inference_lp" title="pystruct.inference.inference_lp"><code class="xref py py-obj docutils literal"><span class="pre">inference.inference_lp</span></code></a>(unary_potentials, ...)</td>
<td>Inference with build-in LP solver using cvxopt backend.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="generated/pystruct.inference.inference_ad3.html#pystruct.inference.inference_ad3" title="pystruct.inference.inference_ad3"><code class="xref py py-obj docutils literal"><span class="pre">inference.inference_ad3</span></code></a>(unary_potentials, ...)</td>
<td>Inference with AD3 dual decomposition subgradient solver.</td>
</tr>
<tr class="row-odd"><td><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-obj docutils literal"><span class="pre">inference.inference_ogm</span></code></a>(unary_potentials, ...)</td>
<td>Inference with OpenGM backend.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="module-pystruct.utils">
<span id="utilities"></span><h1>Utilities<a class="headerlink" href="#module-pystruct.utils" title="Permalink to this headline">¶</a></h1>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.utils.SaveLogger.html#pystruct.utils.SaveLogger" title="pystruct.utils.SaveLogger"><code class="xref py py-obj docutils literal"><span class="pre">utils.SaveLogger</span></code></a>(file_name[, save_every, ...])</td>
<td>Logging class that stores the model periodically.</td>
</tr>
</tbody>
</table>
<div class="section" id="module-pystruct.plot_learning">
<span id="plot-learning"></span><h2>plot_learning<a class="headerlink" href="#module-pystruct.plot_learning" title="Permalink to this headline">¶</a></h2>
<p>This module provides a callable for easy evaluation of stored models.</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="generated/pystruct.plot_learning.plot_learning.html#pystruct.plot_learning.plot_learning" title="pystruct.plot_learning.plot_learning"><code class="xref py py-obj docutils literal"><span class="pre">plot_learning.plot_learning</span></code></a>(ssvm[, time])</td>
<td>Plot optimization curves and cache hits.</td>
</tr>
</tbody>
</table>
</div>
</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>