<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: imaging code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Wed, 27 Aug 2008 19:54:05 GMT</pubDate>
    <description>DZone Snippets: imaging code</description>
    <item>
      <title>Customizable sigmoid function</title>
      <link>http://snippets.dzone.com/posts/show/2620</link>
      <description>&lt;code&gt;&lt;br /&gt;/**&lt;br /&gt; * Calculates S-curve for point x in the interval 0 .. normV&lt;br /&gt; * &lt;br /&gt; * @param x input coordinate&lt;br /&gt; * @param normV scale value which corresponds to 1.0 if x is normalized&lt;br /&gt; * @param sharpness adjusts steepness of curve (value of 1 equals undistorted sigmoid)&lt;br /&gt; *&lt;br /&gt; * @return sigmoid for point X&lt;br /&gt; */&lt;br /&gt;public float sigmoid(float x, float normV, float sharpness) {&lt;br /&gt;  x=(x/normV*2-1)*5*sharpness;&lt;br /&gt;  return 1.0f / (1.0f + (float)Math.exp(-x));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public double sigmoid(double x, double normV, double sharpness) {&lt;br /&gt;  x=(x/normV*2-1)*5*sharpness;&lt;br /&gt;  return 1.0 / (1.0 + Math.exp(-x));&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 18 Sep 2006 17:23:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2620</guid>
      <author>toxi (karsten schmidt)</author>
    </item>
  </channel>
</rss>
