jimpil / enclog Goto Github PK
View Code? Open in Web Editor NEWClojure wrapper for Encog (v3) (Machine-Learning framework that specialises in neural-nets)
Clojure wrapper for Encog (v3) (Machine-Learning framework that specialises in neural-nets)
Is this supported in Clojure 1.8?
At least NeuralGeneticAlgorithm and NEATTraining
For NeuralGeneticAlgoritm, I found there is now org.encog.ml.ea.train.EvolutionaryAlgorithm but I don't know if it can be used analogously.
(ns resilient.core
;;(:use incanter.core)
(:use [enclog nnets training])
(:gen-class))
(defn round-output
"Round outputs to nearest integer."
[output]
(mapv #(Math/round ^Double %) output))
(def dataset
(let [xor-input [[0.0 0.0] [1.0 0.0] [0.0 1.0] [1.0 1.0]]
xor-ideal [[0.0] [1.0] [1.0] [0.0]]]
(data :basic-dataset xor-input xor-ideal)))
(defn train-network [network data trainer-algo]
(let [trainer (trainer trainer-algo
:network network
:training-set data)]
(train trainer 0.01 10000 [])))
(def elman-network (network (neural-pattern :elman)
:activation :sigmoid
:input 2
:output 1
:hidden [3]))
(defn run-network [network input]
(let [input-data (data :basic input)
output (.compute network input-data)
output-vec (.getData output)]
(round-output output-vec)))
(def EN (train-network elman-network dataset :resilient-prop))
as i configure dependencies in project.clj
:dependencies [[org.clojure/clojure "1.6.0"]
[cc.artifice/clj-ml "0.4.0"]
[org.encog/encog-core "3.2.0"]
[enclog "0.6.5"]
[org.clojure/tools.namespace "0.2.5"]
[incanter "1.5.5"]
[clatrix "0.3.0"]
[net.mikera/core.matrix "0.27.0"]]
and the log generate from train-network
function is that
Iteration # 9,978 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,979 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,980 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,981 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,982 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,983 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,984 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,985 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,986 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,987 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,988 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,989 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,990 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,991 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,992 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,993 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,994 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,995 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,996 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,997 Error: 10.879860% Target-Error: 1.000000%
Iteration # 9,998 Error: 20.051045% Target-Error: 1.000000%
Iteration # 9,999 Error: 10.879860% Target-Error: 1.000000%
Iteration # 10,000 Error: 20.051045% Target-Error: 1.000000%
as you can see after iterate to 10000 times it still get a large error...
but when i change encog-core
to 3.1.0 and enclog
to 0.6.3 the log when i train the elman network shows that
Iteration # 146 Error: 6.437994% Target-Error: 1.000000%
Iteration # 147 Error: 6.162065% Target-Error: 1.000000%
Iteration # 148 Error: 5.905370% Target-Error: 1.000000%
Iteration # 149 Error: 5.685170% Target-Error: 1.000000%
Iteration # 150 Error: 8.820329% Target-Error: 1.000000%
Iteration # 151 Error: 6.344310% Target-Error: 1.000000%
Iteration # 152 Error: 6.236660% Target-Error: 1.000000%
Iteration # 153 Error: 6.115702% Target-Error: 1.000000%
Iteration # 154 Error: 5.980763% Target-Error: 1.000000%
Iteration # 155 Error: 5.831186% Target-Error: 1.000000%
Iteration # 156 Error: 5.666209% Target-Error: 1.000000%
Iteration # 157 Error: 5.484842% Target-Error: 1.000000%
Iteration # 158 Error: 5.285799% Target-Error: 1.000000%
Iteration # 159 Error: 5.067628% Target-Error: 1.000000%
Iteration # 160 Error: 4.829173% Target-Error: 1.000000%
Iteration # 161 Error: 4.570456% Target-Error: 1.000000%
Iteration # 162 Error: 4.294153% Target-Error: 1.000000%
Iteration # 163 Error: 4.008254% Target-Error: 1.000000%
Iteration # 164 Error: 3.732056% Target-Error: 1.000000%
Iteration # 165 Error: 3.511699% Target-Error: 1.000000%
Iteration # 166 Error: 3.360398% Target-Error: 1.000000%
Iteration # 167 Error: 3.504944% Target-Error: 1.000000%
Iteration # 168 Error: 4.968425% Target-Error: 1.000000%
Iteration # 169 Error: 0.958797% Target-Error: 1.000000%
when iterate to 169 times and the algorithm converged
so anyone can show me how to fix the issue in enclog
0.6.5 ?
what's more i think resilient propgate algorithm did not perform as well as backpropgate algorithm :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.