📄 gmmtraindemo2dcovtype01.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of gmmTrainDemo2dCovType01</title> <meta name="keywords" content="gmmTrainDemo2dCovType01"> <meta name="description" content="Animation of GMM training with covType=1 (isotropic) for 2D data"> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">dcpr</a> > gmmTrainDemo2dCovType01.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for dcpr <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>gmmTrainDemo2dCovType01</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>Animation of GMM training with covType=1 (isotropic) for 2D data</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>This is a script file. </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> Animation of GMM training with covType=1 (isotropic) for 2D data</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="dcData.html" class="code" title="function DS = dcdata(dataID)">dcData</a> DCDATA Test data sets for data clustering (no class label).</li><li><a href="gmmEval.html" class="code" title="function [logProb, gaussianProb] = gmmEval(data, gmmParam);">gmmEval</a> gmmEval: Evaluation of a GMM (Gaussian mixture model)</li><li><a href="gmmTrain.html" class="code" title="function [gmmParam, logProb] = gmmTrain(data, gaussianNumCovType, gmmTrainParam)">gmmTrain</a> gmmTrain: Parameter training for gaussian mixture model (GMM)</li><li><a href="gmmTrainParamSet.html" class="code" title="function gmmTrainParam=gmmTrainParamSet">gmmTrainParamSet</a> The following parameters are used for gmmTrain()</li></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="gmmTrain.html" class="code" title="function [gmmParam, logProb] = gmmTrain(data, gaussianNumCovType, gmmTrainParam)">gmmTrain</a> gmmTrain: Parameter training for gaussian mixture model (GMM)</li></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <span class="comment">% Animation of GMM training with covType=1 (isotropic) for 2D data</span>0002 0003 <span class="comment">% Data collection</span>0004 DS = <a href="dcData.html" class="code" title="function DS = dcdata(dataID)">dcData</a>(2);0005 data=DS.input;0006 0007 <span class="comment">% GMM training</span>0008 covType=1;0009 gaussianNum=8;0010 gmmTrainParam=<a href="gmmTrainParamSet.html" class="code" title="function gmmTrainParam=gmmTrainParamSet">gmmTrainParamSet</a>;0011 gmmTrainParam.useKmeans=0;0012 gmmTrainParam.dispOpt=1;0013 gmmTrainParam.maxIteration=500;0014 [gmmParam, lp] = <a href="gmmTrain.html" class="code" title="function [gmmParam, logProb] = gmmTrain(data, gaussianNumCovType, gmmTrainParam)">gmmTrain</a>(data, [gaussianNum, covType], gmmTrainParam);0015 0016 <span class="comment">% Surface and contour plots</span>0017 pointNum = 40;0018 x = linspace(min(data(1,:)), max(data(1,:)), pointNum);0019 y = linspace(min(data(2,:)), max(data(2,:)), pointNum);0020 [xx, yy] = meshgrid(x, y);0021 data = [xx(:) yy(:)]';0022 z = <a href="gmmEval.html" class="code" title="function [logProb, gaussianProb] = gmmEval(data, gmmParam);">gmmEval</a>(data, gmmParam);0023 zz = reshape(z, pointNum, pointNum);0024 figure; mesh(xx, yy, zz); axis tight; box on; rotate3d on0025 figure; contour(xx, yy, zz, 30); axis image</pre></div><hr><address>Generated on Thu 30-Oct-2008 12:53:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -