take zero-arge closure

This commit is contained in:
Lyndon White 2019-02-28 15:49:49 +00:00
parent c76b9c7e2c
commit e23c8ddd13
1 changed files with 0 additions and 3 deletions

View File

@ -37,21 +37,18 @@ using Test, Random
@testset "Constructor" begin
mo = MaxOut(() -> identity, 4)
input = rand(40)
@test mo(input) == input
end
@testset "simple alternatives" begin
mo = MaxOut((x -> x, x -> 2x, x -> 0.5x))
input = rand(40)
@test mo(input) == 2*input
end
@testset "complex alternatives" begin
mo = MaxOut((x -> [0.5; 0.1]*x, x -> [0.2; 0.7]*x))
input = [3.0 2.0]
target = [0.5, 0.7].*input
@test mo(input) == target