📄 mixlogsum.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 mixLogSum</title> <meta name="keywords" content="mixLogSum"> <meta name="description" content="mixLogSum: Compute the mixture log sum"> <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> > mixLogSum.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>mixLogSum</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>mixLogSum: Compute the mixture log sum</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function output=mixLogSum(input) </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"> mixLogSum: Compute the mixture log sum
Usage: output=mixLogSum(input)
input=[x, y, z..] is the input vector
output=log(e^x + e^y + e^z...)
This function is more robust, For instance, compare the difference:
mixLogSum([-2000, -1999])
log(sum(exp([-2000, -1999])))
This function is primarily used for computing the log probability of a GMM.
For efficiency, you can use the equivalent mixLogSumMex.dll instead.</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)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></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 <a name="_sub0" href="#_subfunctions" class="code">function output=mixLogSum(input)</a>0002 <span class="comment">% mixLogSum: Compute the mixture log sum</span>0003 <span class="comment">% Usage: output=mixLogSum(input)</span>0004 <span class="comment">% input=[x, y, z..] is the input vector</span>0005 <span class="comment">% output=log(e^x + e^y + e^z...)</span>0006 <span class="comment">%</span>0007 <span class="comment">% This function is more robust, For instance, compare the difference:</span>0008 <span class="comment">% mixLogSum([-2000, -1999])</span>0009 <span class="comment">% log(sum(exp([-2000, -1999])))</span>0010 <span class="comment">%</span>0011 <span class="comment">% This function is primarily used for computing the log probability of a GMM.</span>0012 <span class="comment">% For efficiency, you can use the equivalent mixLogSumMex.dll instead.</span>0013 0014 <span class="comment">% Roger Jang, 20070324</span>0015 0016 <span class="comment">%input=flipud(sort(input(:)));</span>0017 output=input(1);0018 <span class="keyword">for</span> i=2:length(input)0019 <span class="keyword">if</span> output<input(i)0020 temp=output; output=input(i); input(i)=temp;0021 <span class="keyword">end</span>0022 output=output+log(1+exp(input(i)-output));0023 <span class="keyword">end</span></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 + -