1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: Mixture of Gaussians (MOG)</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | </div> |
---|
60 | <div class="contents"> |
---|
61 | <h1>Mixture of Gaussians (MOG)<br> |
---|
62 | <small> |
---|
63 | [<a class="el" href="group__stat.html">Statistics Module</a>]</small> |
---|
64 | </h1>Classes and functions for modelling multivariate data as a Mixture of Gaussians. |
---|
65 | <a href="#_details">More...</a> |
---|
66 | <p> |
---|
67 | <table border="0" cellpadding="0" cellspacing="0"> |
---|
68 | <tr><td></td></tr> |
---|
69 | <tr><td colspan="2"><br><h2>Classes</h2></td></tr> |
---|
70 | <tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1MOG__diag.html">itpp::MOG_diag</a></td></tr> |
---|
71 | |
---|
72 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Diagonal Mixture of Gaussians (MOG) class. <a href="classitpp_1_1MOG__diag.html#_details">More...</a><br></td></tr> |
---|
73 | <tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1MOG__generic.html">itpp::MOG_generic</a></td></tr> |
---|
74 | |
---|
75 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Generic Mixture of Gaussians (MOG) class. Used as a base for other MOG classes. <a href="classitpp_1_1MOG__generic.html#_details">More...</a><br></td></tr> |
---|
76 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
---|
77 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__MOG.html#g7b86d84e61a3056418f08b7ac0686805">itpp::MOG_diag_ML</a> (MOG_diag &model_in, Array< <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> > &X_in, int max_iter_in, double var_floor_in, double weight_floor_in, bool verbose_in)</td></tr> |
---|
78 | |
---|
79 | <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__MOG.html#gdeb91bf337a38234135d6d402e3143b3">itpp::MOG_diag_kmeans</a> (MOG_diag &model_in, Array< <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> > &X_in, int max_iter_in, double trust_in, bool normalise_in, bool verbose_in)</td></tr> |
---|
80 | |
---|
81 | </table> |
---|
82 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
83 | Classes and functions for modelling multivariate data as a Mixture of Gaussians. |
---|
84 | <p> |
---|
85 | <dl class="author" compact><dt><b>Author:</b></dt><dd>Conrad Sanderson</dd></dl> |
---|
86 | The following example shows how to model data: <div class="fragment"><pre class="fragment"> Array<vec> X; |
---|
87 | <span class="comment">// ... fill X with vectors ...</span> |
---|
88 | <span class="keywordtype">int</span> K = 3; <span class="comment">// specify the number of Gaussians</span> |
---|
89 | <span class="keywordtype">int</span> D = 10; <span class="comment">// specify the dimensionality of vectors</span> |
---|
90 | MOG_diag model(K,D); |
---|
91 | <a class="code" href="group__MOG.html#gdeb91bf337a38234135d6d402e3143b3">MOG_diag_kmeans</a>(model, X, 10, 0.5, <span class="keyword">true</span>, <span class="keyword">true</span>); <span class="comment">// initial optimisation using 10 iterations of k-means</span> |
---|
92 | <a class="code" href="group__MOG.html#g7b86d84e61a3056418f08b7ac0686805">MOG_diag_ML</a>(model, X, 10, 0.0, 0.0, <span class="keyword">true</span>); <span class="comment">// final optimisation using 10 iterations of ML version of EM</span> |
---|
93 | <span class="keywordtype">double</span> avg = model.avg_log_lhood(X); <span class="comment">// find the average log likelihood of X</span> |
---|
94 | </pre></div><p> |
---|
95 | See also the tutorial section for a more elaborate example. <hr><h2>Function Documentation</h2> |
---|
96 | <a class="anchor" name="gdeb91bf337a38234135d6d402e3143b3"></a><!-- doxytag: member="itpp::MOG_diag_kmeans" ref="gdeb91bf337a38234135d6d402e3143b3" args="(MOG_diag &model_in, Array< vec > &X_in, int max_iter_in, double trust_in, bool normalise_in, bool verbose_in)" --> |
---|
97 | <div class="memitem"> |
---|
98 | <div class="memproto"> |
---|
99 | <table class="memname"> |
---|
100 | <tr> |
---|
101 | <td class="memname">void itpp::MOG_diag_kmeans </td> |
---|
102 | <td>(</td> |
---|
103 | <td class="paramtype">MOG_diag & </td> |
---|
104 | <td class="paramname"> <em>model_in</em>, </td> |
---|
105 | </tr> |
---|
106 | <tr> |
---|
107 | <td class="paramkey"></td> |
---|
108 | <td></td> |
---|
109 | <td class="paramtype">Array< <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> > & </td> |
---|
110 | <td class="paramname"> <em>X_in</em>, </td> |
---|
111 | </tr> |
---|
112 | <tr> |
---|
113 | <td class="paramkey"></td> |
---|
114 | <td></td> |
---|
115 | <td class="paramtype">int </td> |
---|
116 | <td class="paramname"> <em>max_iter_in</em> = <code>10</code>, </td> |
---|
117 | </tr> |
---|
118 | <tr> |
---|
119 | <td class="paramkey"></td> |
---|
120 | <td></td> |
---|
121 | <td class="paramtype">double </td> |
---|
122 | <td class="paramname"> <em>trust_in</em> = <code>0.5</code>, </td> |
---|
123 | </tr> |
---|
124 | <tr> |
---|
125 | <td class="paramkey"></td> |
---|
126 | <td></td> |
---|
127 | <td class="paramtype">bool </td> |
---|
128 | <td class="paramname"> <em>normalise_in</em> = <code>true</code>, </td> |
---|
129 | </tr> |
---|
130 | <tr> |
---|
131 | <td class="paramkey"></td> |
---|
132 | <td></td> |
---|
133 | <td class="paramtype">bool </td> |
---|
134 | <td class="paramname"> <em>verbose_in</em> = <code>false</code></td><td> </td> |
---|
135 | </tr> |
---|
136 | <tr> |
---|
137 | <td></td> |
---|
138 | <td>)</td> |
---|
139 | <td></td><td></td><td></td> |
---|
140 | </tr> |
---|
141 | </table> |
---|
142 | </div> |
---|
143 | <div class="memdoc"> |
---|
144 | |
---|
145 | <p> |
---|
146 | <dl class="author" compact><dt><b>Author:</b></dt><dd>Conrad Sanderson</dd></dl> |
---|
147 | K-means based optimisation (training) of the parameters of an instance of the <a class="el" href="classitpp_1_1MOG__diag.html" title="Diagonal Mixture of Gaussians (MOG) class.">MOG_diag</a> class. The obtained parameters are typically used as a seed by <a class="el" href="group__MOG.html#g7b86d84e61a3056418f08b7ac0686805">MOG_diag_ML()</a>.<p> |
---|
148 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
149 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
150 | <tr><td valign="top"></td><td valign="top"><em>model_in</em> </td><td>The model to optimise </td></tr> |
---|
151 | <tr><td valign="top"></td><td valign="top"><em>X_in</em> </td><td>The training data </td></tr> |
---|
152 | <tr><td valign="top"></td><td valign="top"><em>max_iter_in</em> </td><td>Maximum number of iterations. Default is 10. </td></tr> |
---|
153 | <tr><td valign="top"></td><td valign="top"><em>trust_in</em> </td><td>The trust factor, where 0 <= <code>trust_in</code> <= 1. Default is 0.5. </td></tr> |
---|
154 | <tr><td valign="top"></td><td valign="top"><em>normalise_in</em> </td><td>Use normalised distance measure (in effect). Default is true. </td></tr> |
---|
155 | <tr><td valign="top"></td><td valign="top"><em>verbose_in</em> </td><td>Whether to print progress. Default is false.</td></tr> |
---|
156 | </table> |
---|
157 | </dl> |
---|
158 | <dl class="note" compact><dt><b>Note:</b></dt><dd>The higher the trust factor, the more we trust the estimates of covariance matrices and weights. Set this to 1.0 only if you have plenty of training data. One rule of thumb is to have 10*D vectors per Gaussian, where D is the dimensionality of the vectors. For smaller amounts of data, a lower trust factor will help (but not completely avoid) the EM algorithm ( used in <a class="el" href="group__MOG.html#g7b86d84e61a3056418f08b7ac0686805">MOG_diag_ML()</a> ) from getting stuck in a local minimum.<p> |
---|
159 | Setting <code>normalise_in</code> to true causes the the training data to be normalised to zero mean and unit variance prior to running the k-means algorithm. The data is unnormalised before returning. The normalisation helps clustering when the range of values varies greatly between dimensions. e.g. dimension 1 may have values in the [-1,+1] interval, while dimension 2 may have values in the [-100,+100] interval. Without normalisation, the distance between vectors is dominated by dimension 2. </dd></dl> |
---|
160 | |
---|
161 | <p>References <a class="el" href="mog__diag__kmeans_8cpp-source.html#l00264">itpp::MOG_diag_kmeans_sup::run()</a>.</p> |
---|
162 | |
---|
163 | </div> |
---|
164 | </div><p> |
---|
165 | <a class="anchor" name="g7b86d84e61a3056418f08b7ac0686805"></a><!-- doxytag: member="itpp::MOG_diag_ML" ref="g7b86d84e61a3056418f08b7ac0686805" args="(MOG_diag &model_in, Array< vec > &X_in, int max_iter_in, double var_floor_in, double weight_floor_in, bool verbose_in)" --> |
---|
166 | <div class="memitem"> |
---|
167 | <div class="memproto"> |
---|
168 | <table class="memname"> |
---|
169 | <tr> |
---|
170 | <td class="memname">void itpp::MOG_diag_ML </td> |
---|
171 | <td>(</td> |
---|
172 | <td class="paramtype">MOG_diag & </td> |
---|
173 | <td class="paramname"> <em>model_in</em>, </td> |
---|
174 | </tr> |
---|
175 | <tr> |
---|
176 | <td class="paramkey"></td> |
---|
177 | <td></td> |
---|
178 | <td class="paramtype">Array< <a class="el" href="classitpp_1_1Vec.html#02e1bb55f60f3c2eb7a020eb1c2cfcf4">vec</a> > & </td> |
---|
179 | <td class="paramname"> <em>X_in</em>, </td> |
---|
180 | </tr> |
---|
181 | <tr> |
---|
182 | <td class="paramkey"></td> |
---|
183 | <td></td> |
---|
184 | <td class="paramtype">int </td> |
---|
185 | <td class="paramname"> <em>max_iter_in</em> = <code>10</code>, </td> |
---|
186 | </tr> |
---|
187 | <tr> |
---|
188 | <td class="paramkey"></td> |
---|
189 | <td></td> |
---|
190 | <td class="paramtype">double </td> |
---|
191 | <td class="paramname"> <em>var_floor_in</em> = <code>0.0</code>, </td> |
---|
192 | </tr> |
---|
193 | <tr> |
---|
194 | <td class="paramkey"></td> |
---|
195 | <td></td> |
---|
196 | <td class="paramtype">double </td> |
---|
197 | <td class="paramname"> <em>weight_floor_in</em> = <code>0.0</code>, </td> |
---|
198 | </tr> |
---|
199 | <tr> |
---|
200 | <td class="paramkey"></td> |
---|
201 | <td></td> |
---|
202 | <td class="paramtype">bool </td> |
---|
203 | <td class="paramname"> <em>verbose_in</em> = <code>false</code></td><td> </td> |
---|
204 | </tr> |
---|
205 | <tr> |
---|
206 | <td></td> |
---|
207 | <td>)</td> |
---|
208 | <td></td><td></td><td></td> |
---|
209 | </tr> |
---|
210 | </table> |
---|
211 | </div> |
---|
212 | <div class="memdoc"> |
---|
213 | |
---|
214 | <p> |
---|
215 | <dl class="author" compact><dt><b>Author:</b></dt><dd>Conrad Sanderson</dd></dl> |
---|
216 | Maximum Likelihood Expectation Maximisation based optimisation of the parameters of an instance of the <a class="el" href="classitpp_1_1MOG__diag.html" title="Diagonal Mixture of Gaussians (MOG) class.">MOG_diag</a> class. The seed values (starting points) are typically first obtained via <a class="el" href="group__MOG.html#gdeb91bf337a38234135d6d402e3143b3">MOG_diag_kmeans()</a>. See [CSB06] and the references therein for detailed mathematical descriptions.<p> |
---|
217 | <ul> |
---|
218 | <li>[CSB06] <a href="http://ieeexplore.ieee.org/xpl/abs_free.jsp?arNumber=1561601">F. Cardinaux, C. Sanderson and S. Bengio, "User authentication via adapted statistical models of face images", IEEE Transactions on Signal Processing, Vol 54, No. 1, 2006, pp. 361-373. </a></li></ul> |
---|
219 | <p> |
---|
220 | <dl compact><dt><b>Parameters:</b></dt><dd> |
---|
221 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
222 | <tr><td valign="top"></td><td valign="top"><em>model_in</em> </td><td>The model to optimise (<a class="el" href="classitpp_1_1MOG__diag.html" title="Diagonal Mixture of Gaussians (MOG) class.">MOG_diag</a>) </td></tr> |
---|
223 | <tr><td valign="top"></td><td valign="top"><em>X_in</em> </td><td>The training data (array of vectors) </td></tr> |
---|
224 | <tr><td valign="top"></td><td valign="top"><em>max_iter_in</em> </td><td>Maximum number of iterations. Default is 10. </td></tr> |
---|
225 | <tr><td valign="top"></td><td valign="top"><em>var_floor_in</em> </td><td>Variance floor (lowest allowable variance). Default is 0.0 (but see the note below) </td></tr> |
---|
226 | <tr><td valign="top"></td><td valign="top"><em>weight_floor_in</em> </td><td>Weight floor (lowest allowable weight). Default is 0.0 (but see the note below) </td></tr> |
---|
227 | <tr><td valign="top"></td><td valign="top"><em>verbose_in</em> </td><td>Whether progress in printed. Default is false.</td></tr> |
---|
228 | </table> |
---|
229 | </dl> |
---|
230 | <dl class="note" compact><dt><b>Note:</b></dt><dd>The variance and weight floors are set to <a class="el" href="group__miscfunc.html#g814aaa20dabe8eeb87c95116491a0341" title="Minimum value of vector.">std::numeric_limits<double>::min()</a> if they are below that value. As such, they are machine dependant. The largest allowable weight floor is 1/K, where K is the number of Gaussians. </dd></dl> |
---|
231 | |
---|
232 | <p>References <a class="el" href="mog__diag__em_8cpp-source.html#l00228">itpp::MOG_diag_EM_sup::ml()</a>.</p> |
---|
233 | |
---|
234 | </div> |
---|
235 | </div><p> |
---|
236 | </div> |
---|
237 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:14 2009 for mixpp by |
---|
238 | <a href="http://www.doxygen.org/index.html"> |
---|
239 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
240 | </body> |
---|
241 | </html> |
---|