test affine graph structure
This commit is contained in:
parent
42ce2fadf1
commit
2a4b39054f
@ -3,3 +3,10 @@ xs = randn(10)' # TODO: batching semantics
|
|||||||
d = Affine(10, 20)
|
d = Affine(10, 20)
|
||||||
|
|
||||||
@test d(xs) == xs*d.W.x + d.b.x
|
@test d(xs) == xs*d.W.x + d.b.x
|
||||||
|
|
||||||
|
@testset begin
|
||||||
|
@capture(syntax(d), x_[1] * W_ + b_)
|
||||||
|
@test isa(x, Input)
|
||||||
|
@test isa(W, Param)
|
||||||
|
@test isa(b, Param)
|
||||||
|
end
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
using Flux
|
using Flux, DataFlow, MacroTools, Base.Test
|
||||||
using Base.Test
|
using Flux: graph, Param
|
||||||
|
using DataFlow: Input
|
||||||
|
|
||||||
|
syntax(v::Vertex) = prettify(DataFlow.syntax(v))
|
||||||
|
syntax(x) = syntax(graph(x))
|
||||||
|
|
||||||
include("basic.jl")
|
include("basic.jl")
|
||||||
include("recurrent.jl")
|
include("recurrent.jl")
|
||||||
|
Loading…
Reference in New Issue
Block a user