On 08/09/12 16:56, Denis Labaye wrote:
Anyway, it works fine with the 0.5.2-SNAPSHOT (I've got "network
traing" logs), but how do I use the network I just trained ?
In your example I would like to give it a new input, and see if "it"
learned correctly his xor lesson :)
basically, you need to make the dataset you want and then do something
like the following:
(doseq [pair dataset]
(let [output (.compute network (.getInput pair))] ;;test the
network
(println (.getData (.getInput pair) 0) "," (. (. pair getInput)
getData 1)
", actual=" (.getData
output 0)
", ideal=" (.getData
(.getIdeal pair) 0))))
conveniently, there is a "evaluate" macro to hide all that in the
training namespace...
so what I would do is this:
(let [xor-alt-input [[2.0 2.0] [0.0 0.0] [2.0 0.0] [0.0 2.0]] ;;your
alternative input
xor-alt-ideal [[0.0] [0.0] [1.0] [1.0]] ;;the ideal for your input
dataset (data :basic-dataset xor-alt-input xor-alt-ideal)]
(evaluate network dataset)) ;as usual
Jim
ps: the xor problem is really a toy example - all the possible
combinations already exist in the training data...there is no way really
to generate your own input that the network has not seen. look in
examples.clj for some examples...there is also a main fn that will run
all the examples...
--
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