remove diff code for now

This commit is contained in:
Mike J Innes 2016-12-15 22:39:48 +00:00
parent f3555a9c57
commit de6c3ef07e
2 changed files with 0 additions and 31 deletions

View File

@ -13,7 +13,6 @@ include("model.jl")
include("utils.jl")
include("data.jl")
include("compiler/diff.jl")
include("compiler/code.jl")
include("compiler/loops.jl")
include("compiler/interp.jl")

View File

@ -1,30 +0,0 @@
addΔ(a, b) = vertex(:+, a, b)
# Special case a couple of operators to clean up output code
const symbolic = Dict()
symbolic[:+] = (Δ, args...) -> map(_->Δ, args)
function ∇v(v::Vertex, Δ)
haskey(symbolic, value(v)) && return symbolic[value(v)](Δ, inputs(v)...)
Δ = vertex(:back!, constant(value(v)), constant(Δ), inputs(v)...)
map(i -> @flow(getindex($Δ, $i)), 1:DataFlow.nin(v))
end
function invert(v::IVertex, Δ = , out = d())
@assert !iscyclic(v)
if isconstant(v)
@assert !haskey(out, value(v))
out[value(v).value] = constant(Δ)
else
Δs = ∇v(v, Δ)
for (v, Δ′) in zip(inputs(v), Δs)
invert(v, Δ′, out)
end
end
return out
end
back!(::typeof(+), Δ, args...) = map(_ -> Δ, args)
back!(::typeof(*), Δ, a, b) = Δ*b', a'*Δ