<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Log Sum of Exponentials</title>
	<atom:link href="http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/feed/" rel="self" type="application/rss+xml" />
	<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/</link>
	<description>Natural Language Processing and Text Analytics</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:56:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Martin</title>
		<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/#comment-5142</link>
		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Tue, 14 Jul 2009 00:46:41 +0000</pubDate>
		<guid isPermaLink="false">http://lingpipe-blog.com/?p=1637#comment-5142</guid>
		<description><![CDATA[In my limited experience, the more useful function to approximate is f(x) = log(1+exp(x)).  You only need to do that for x&gt;=0 or x&lt;=0.  For sufficiently large x, log(1+exp(x)) ~= x; and for sufficiently small x (e.g. x &lt; 750 in IEEE double precision), log(1+exp(x)) ~= 0.  Moreover, the difference between the function and its asymptotes is symmetric about 0, i.e., f(x) - x == f(-x).  So you only need an approximation for f near 0 and only on one side of 0.  A rational approximation of f can usually be evaluated much faster than log (or log1p) and exp, since each one of those is actually computed by a polynomial or rational approximation in turn.

(Aside: f should be familiar, though what usually shows up is df/dx.)]]></description>
		<content:encoded><![CDATA[<p>In my limited experience, the more useful function to approximate is f(x) = log(1+exp(x)).  You only need to do that for x&gt;=0 or x&lt;=0.  For sufficiently large x, log(1+exp(x)) ~= x; and for sufficiently small x (e.g. x &lt; 750 in IEEE double precision), log(1+exp(x)) ~= 0.  Moreover, the difference between the function and its asymptotes is symmetric about 0, i.e., f(x) &#8211; x == f(-x).  So you only need an approximation for f near 0 and only on one side of 0.  A rational approximation of f can usually be evaluated much faster than log (or log1p) and exp, since each one of those is actually computed by a polynomial or rational approximation in turn.</p>
<p>(Aside: f should be familiar, though what usually shows up is df/dx.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lingpipe</title>
		<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/#comment-4954</link>
		<dc:creator><![CDATA[lingpipe]]></dc:creator>
		<pubDate>Fri, 26 Jun 2009 04:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://lingpipe-blog.com/?p=1637#comment-4954</guid>
		<description><![CDATA[sth4nth is talking about &lt;a href=&quot;http://lingpipe-blog.com/2009/03/17/softmax-without-overflow/#comment-4216&quot; rel=&quot;nofollow&quot;&gt;his or her comment&lt;/a&gt; on my &lt;a href=&quot;http://lingpipe-blog.com/2009/03/17/softmax-without-overflow/&quot; rel=&quot;nofollow&quot;&gt;softmax without overflow&lt;/a&gt; blog entry.  

Sorry I&#039;m so slow with all this arithmetic precision stuff; I should&#039;ve definitely put exp(2) and exp(2) together in this case.]]></description>
		<content:encoded><![CDATA[<p>sth4nth is talking about <a href="http://lingpipe-blog.com/2009/03/17/softmax-without-overflow/#comment-4216" rel="nofollow">his or her comment</a> on my <a href="http://lingpipe-blog.com/2009/03/17/softmax-without-overflow/" rel="nofollow">softmax without overflow</a> blog entry.  </p>
<p>Sorry I&#8217;m so slow with all this arithmetic precision stuff; I should&#8217;ve definitely put exp(2) and exp(2) together in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sth4nth</title>
		<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/#comment-4953</link>
		<dc:creator><![CDATA[sth4nth]]></dc:creator>
		<pubDate>Fri, 26 Jun 2009 02:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://lingpipe-blog.com/?p=1637#comment-4953</guid>
		<description><![CDATA[That&#039;s what I said in the replay of the logistic regression post.]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s what I said in the replay of the logistic regression post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lingpipe</title>
		<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/#comment-4951</link>
		<dc:creator><![CDATA[lingpipe]]></dc:creator>
		<pubDate>Thu, 25 Jun 2009 20:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://lingpipe-blog.com/?p=1637#comment-4951</guid>
		<description><![CDATA[Thanks for reminding me about the special log calculation.

For everyone else who&#039;s not knee deep in these derivations, the binary case is:

log(exp(a) + exp(b)) = a + log(1 + exp(b-a)) 

and this is where the special calculation for log(1+x) comes into play.  

Check out &lt;a href=&quot;http://www.johndcook.com/cpp_log_one_plus_x.html&quot; rel=&quot;nofollow&quot;&gt;John Cook&#039;s discussion of log(1+x)&lt;/a&gt;, which uses a Taylor approximation for x &lt; 1e-4 (that is, x &lt; 0.0001), and simply makes a lib call otherwise.]]></description>
		<content:encoded><![CDATA[<p>Thanks for reminding me about the special log calculation.</p>
<p>For everyone else who&#8217;s not knee deep in these derivations, the binary case is:</p>
<p>log(exp(a) + exp(b)) = a + log(1 + exp(b-a)) </p>
<p>and this is where the special calculation for log(1+x) comes into play.  </p>
<p>Check out <a href="http://www.johndcook.com/cpp_log_one_plus_x.html" rel="nofollow">John Cook&#8217;s discussion of log(1+x)</a>, which uses a Taylor approximation for x &lt; 1e-4 (that is, x &lt; 0.0001), and simply makes a lib call otherwise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Graehl</title>
		<link>http://lingpipe-blog.com/2009/06/25/log-sum-of-exponentials/#comment-4950</link>
		<dc:creator><![CDATA[Jonathan Graehl]]></dc:creator>
		<pubDate>Thu, 25 Jun 2009 20:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://lingpipe-blog.com/?p=1637#comment-4950</guid>
		<description><![CDATA[Many of us have defined the same operation pairwise so as to have (with operator overloading) numbers which have the usual operations.  In adding pairwise you can use a special function to compute log(1+x) which is more accurate for small x - &quot;log1p&quot;.  You could use that in your vector operation as well, although it would only be relevant if all the numbers were MUCH smaller than the maximum.]]></description>
		<content:encoded><![CDATA[<p>Many of us have defined the same operation pairwise so as to have (with operator overloading) numbers which have the usual operations.  In adding pairwise you can use a special function to compute log(1+x) which is more accurate for small x &#8211; &#8220;log1p&#8221;.  You could use that in your vector operation as well, although it would only be relevant if all the numbers were MUCH smaller than the maximum.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

