2016-12-15 22:31:39 +00:00
|
|
|
xs = randn(10)' # TODO: batching semantics
|
|
|
|
|
|
|
|
d = Affine(10, 20)
|
|
|
|
|
|
|
|
@test d(xs) == xs*d.W.x + d.b.x
|
2016-12-15 23:11:35 +00:00
|
|
|
|
2016-12-15 23:13:20 +00:00
|
|
|
let
|
2016-12-15 23:11:35 +00:00
|
|
|
@capture(syntax(d), x_[1] * W_ + b_)
|
2016-12-15 23:13:20 +00:00
|
|
|
@test isa(x, Input) && isa(W, Param) && isa(b, Param)
|
2016-12-15 23:11:35 +00:00
|
|
|
end
|