Commit e648c49b authored by oniall's avatar oniall
Browse files

pushing new models

parent acb58acc
module SimpleNeuralNetwork
# http://www.itl.nist.gov/div898/strd/nls/data/lanczos1.shtml
import Models
using DelimitedFiles
name = "SimpNN"
n = 9
m = 25
I = range(-1, length=25, stop=1)
y = []
for i=1:length(I)
push!(y, cos(I[i]))
end
n1=tanh(w[1]*I + b[1])
n2=tanh(w[2]*n1 + b[2])
n3=tanh(w[3]*n1 + b[3])
n4=tanh(w[4]*n2 + w[5]*n3 + b[4])
rbare(w) = n4
r(w) = y - rbare(w)
model = Models.ModelAD(m, n, r, name)
modelbare = Models.ModelAD(m, n, rbare, name*"bare")
simpNN = model
simplNNbare = modelbare
export simpNN, simpNNbare
end
......@@ -13,12 +13,12 @@ t = data[:,2]
y = data[:,1]
rbare(w) = (exp.(w[1]) .+ exp.(w[2])*t + exp.(w[3])*t.^2 + exp.(w[4])*t.^3)./(1 .+ exp.(w[5])*t + exp.(w[6])*t.^2 + exp.(w[7])*t.^3)
r(w) = y - rbare(x)
r(w) = y - rbare(w)
wi = [log(1.0000000000E+03), log(1.0000000000E+03), log(4.0000000000E+02), log(4.0000000000E+01), log(7.0000000000E-01), log(3.0000000000E-01), log(3.0000000000E-02)]
wi2 = [log(1.3000000000E+03), log(1.5000000000E+03), log(5.0000000000E+02), log(7.5000000000E+01), log(1.0000000000E+00), log(4.0000000000E-01), log(5.0000000000E-02)]
xbf = [log(1.2881396800E+03), log(1.4910792535E+03), log(5.8323836877E+02), log(7.5416644291E+01), log(9.6629502864E-01), log(3.9797285797E-01), log(4.9727297349E-02)]
wbf = [log(1.2881396800E+03), log(1.4910792535E+03), log(5.8323836877E+02), log(7.5416644291E+01), log(9.6629502864E-01), log(3.9797285797E-01), log(4.9727297349E-02)]
fbf = 5.6427082397E+03
model = Models.ModelAD(m, n, r, name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment