capacitor type for bpat

This commit is contained in:
Mike J Innes 2016-06-14 01:40:36 +01:00
parent 1480e1fab6
commit a643447fad
3 changed files with 11 additions and 2 deletions

View File

@ -7,12 +7,13 @@ using MacroTools, Lazy, Flow
export Model, back!, update! export Model, back!, update!
abstract Model abstract Model
abstract Capacitor <: Model
abstract Activation <: Model abstract Activation <: Model
back!(m::Model, ) = error("Backprop not implemented for $(typeof(m))") back!(m::Model, ) = error("Backprop not implemented for $(typeof(m))")
update!(m::Model, η) = m update!(m::Model, η) = m
include("capacitor.jl")
include("compiler/diff.jl") include("compiler/diff.jl")
include("compiler/loop.jl") include("compiler/loop.jl")
include("compiler/code.jl") include("compiler/code.jl")

8
src/capacitor.jl Normal file
View File

@ -0,0 +1,8 @@
type Capacitor{T}
Δs::Vector{T}
end
type Patch{T}
η::Float32
Δs::Capacitor{T}
end

View File

@ -1,6 +1,6 @@
export Sequence export Sequence
type Sequence <: Capacitor type Sequence
layers::Vector{Model} layers::Vector{Model}
end end