sub-model test
This commit is contained in:
parent
4e27f2a405
commit
e15a6e4896
@ -8,3 +8,17 @@ let
|
|||||||
@capture(syntax(d), _Frame(_Line(x_[1] * W_ + b_)))
|
@capture(syntax(d), _Frame(_Line(x_[1] * W_ + b_)))
|
||||||
@test isa(x, Input) && isa(W, Param) && isa(b, Param)
|
@test isa(x, Input) && isa(W, Param) && isa(b, Param)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@net type TLP
|
||||||
|
first
|
||||||
|
second
|
||||||
|
function (x)
|
||||||
|
l1 = σ(first(x))
|
||||||
|
l2 = softmax(second(l1))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
let a1 = Affine(10, 20), a2 = Affine(20, 15)
|
||||||
|
tlp = TLP(a1, a2)
|
||||||
|
@test tlp(xs) ≈ softmax(a2(σ(a1(xs))))
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user