From bc7ee0967c3d223d4ddfb187641afc862ec75c78 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Tue, 23 Aug 2016 10:43:30 +0100 Subject: [PATCH] this served its purpose --- examples/sketch.jl | 57 ---------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 examples/sketch.jl diff --git a/examples/sketch.jl b/examples/sketch.jl deleted file mode 100644 index ecb1c85f..00000000 --- a/examples/sketch.jl +++ /dev/null @@ -1,57 +0,0 @@ -# Simple Perceptron Layer - -@flux type Simple - weight - bias - x -> σ( weight*x + bias ) -end - -Simple(nx::Integer, ny::Integer; init = randn) = - Simple(init(nx, ny), init(ny)) - -# Time Delay Node - -type Delay - n::Int - next -end - -# feed(l::Delay, x) = ... - -# back(l::Delay, y) = ... - -# Simple Recurrent - -@flux type RecurrentU - Wxh; Whh; Bh - Wxy; Why; By - - function feed(x, hidden) - hidden′ = σ( Wxh*x + Whh*hidden + Bh ) - y = σ( Wxy*x + Why*hidden′ + By ) - y, hidden′ - end -end - -Recurrent(nx, ny, nh; init = randn) = - Recurrent(init(nx, nh), init(nh, nh), init(nh), - init(nx, ny), init(nh, ny), init(ny)) - -@flux type Looped{T} - delay::Delay - layer::T - - function (x) - y, hidden = layer(x, delay(hidden)) - return y - end -end - -type Recurrent - layer::Looped{RecurrentU} -end - -Recurrent(nx, ny, nh; init = randn, delay = 10) = - Looped(Delay(delay, init(nh)), RecurrentU(nx, ny, nh)) - -@forward Recurrent.layer feed