On 7/28/12 4:52 PM, Timothy Washington wrote:
Hey Jim,
Encog does look very interesting. Right now, I'm trying (and failing)
to implement the sigmoid function. I'm using wikipedia's reference
<http://en.wikipedia.org/wiki/Sigmoid_function>, and trying to
use Incanter's (incanter/exp) function, but Incanter's function
doesn't seem to work:
user> user> (incanter/exp -3254604.9658621363)
0.0
user> user> (incanter/exp 3254604.9658621363)
Infinity
Try this...
(use 'incanter.core)
=> (defn sigmoid [z]
(div 1 (plus 1 (exp (minus z)))))
=> (sigmoid 0)
0.5
=> (sigmoid 7)
0.9990889488055994
=> (sigmoid 112)
1.0
=> (sigmoid -112)
2.285693676718672E-49
If you want the library to be fast you will want to be using primitives
or use the underlying colt API.. for learning purposes you don't really
need to worry about that though.
HTH,
Ben
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en