no arg closures

This commit is contained in:
Lyndon White 2019-03-21 17:04:52 +00:00
parent 7d247ea25b
commit 401d3da884

View File

@ -147,7 +147,7 @@ struct Maxout{FS<:Tuple}
end end
""" """
Maxout(f, n_alts, args...; kwargs...) Maxout(f, n_alts)
Constructs a Maxout layer over `n_alts` instances of the layer given by `f`. Constructs a Maxout layer over `n_alts` instances of the layer given by `f`.
The function takes no arguement and should return some callable layer. The function takes no arguement and should return some callable layer.
@ -162,8 +162,8 @@ each identical in structure (784 inputs, 128 outputs).
Maxout(()->Dense(insize, outsize), 4) Maxout(()->Dense(insize, outsize), 4)
``` ```
""" """
function Maxout(f, n_alts, args...; kwargs...) function Maxout(f, n_alts)
over = Tuple(f(args...; kwargs...) for _ in 1:n_alts) over = Tuple(f() for _ in 1:n_alts)
return Maxout(over) return Maxout(over)
end end