more test sets
This commit is contained in:
parent
41c64dc8c7
commit
22fa22f18a
@ -1,14 +1,3 @@
|
|||||||
xs = randn(10)
|
|
||||||
|
|
||||||
d = Affine(10, 20)
|
|
||||||
|
|
||||||
@test d(xs) ≈ (xs'*d.W.x + d.b.x)[1,:]
|
|
||||||
|
|
||||||
let
|
|
||||||
@capture(syntax(d), _Frame(_Line(x_[1] * W_ + b_)))
|
|
||||||
@test isa(x, DataFlow.Input) && isa(W, Param) && isa(b, Param)
|
|
||||||
end
|
|
||||||
|
|
||||||
@net type TLP
|
@net type TLP
|
||||||
first
|
first
|
||||||
second
|
second
|
||||||
@ -18,6 +7,18 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@testset "Basics" begin
|
||||||
|
|
||||||
|
xs = randn(10)
|
||||||
|
d = Affine(10, 20)
|
||||||
|
|
||||||
|
@test d(xs) ≈ (xs'*d.W.x + d.b.x)[1,:]
|
||||||
|
|
||||||
|
let
|
||||||
|
@capture(syntax(d), _Frame(_Line(x_[1] * W_ + b_)))
|
||||||
|
@test isa(x, DataFlow.Input) && isa(W, Param) && isa(b, Param)
|
||||||
|
end
|
||||||
|
|
||||||
let a1 = Affine(10, 20), a2 = Affine(20, 15)
|
let a1 = Affine(10, 20), a2 = Affine(20, 15)
|
||||||
tlp = TLP(a1, a2)
|
tlp = TLP(a1, a2)
|
||||||
@test tlp(xs) ≈ softmax(a2(σ(a1(xs))))
|
@test tlp(xs) ≈ softmax(a2(σ(a1(xs))))
|
||||||
@ -33,3 +34,5 @@ let tlp = TLP(Affine(10, 21), Affine(20, 15))
|
|||||||
@test e.trace[end].func == :TLP
|
@test e.trace[end].func == :TLP
|
||||||
@test e.trace[end-1].func == Symbol("Flux.Affine")
|
@test e.trace[end-1].func == Symbol("Flux.Affine")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
@testset "Batching" begin
|
||||||
|
|
||||||
bs = Batch([[1,2,3],[4,5,6]])
|
bs = Batch([[1,2,3],[4,5,6]])
|
||||||
|
|
||||||
@test typeof(bs) <: Batch
|
@test typeof(bs) <: Batch
|
||||||
@ -5,3 +7,5 @@ bs = Batch([[1,2,3],[4,5,6]])
|
|||||||
@test bs == [[1,2,3],[4,5,6]]
|
@test bs == [[1,2,3],[4,5,6]]
|
||||||
|
|
||||||
@test rawbatch(bs) == [1 2 3; 4 5 6]
|
@test rawbatch(bs) == [1 2 3; 4 5 6]
|
||||||
|
|
||||||
|
end
|
||||||
|
@ -15,6 +15,5 @@ end
|
|||||||
|
|
||||||
include("batching.jl")
|
include("batching.jl")
|
||||||
include("basic.jl")
|
include("basic.jl")
|
||||||
include("recurrent.jl")
|
|
||||||
@tfonly include("backend/tensorflow.jl")
|
@tfonly include("backend/tensorflow.jl")
|
||||||
@mxonly include("backend/mxnet.jl")
|
@mxonly include("backend/mxnet.jl")
|
||||||
|
Loading…
Reference in New Issue
Block a user