batchnorm: more test cases

This commit is contained in:
Iblis Lin 2017-10-30 13:37:48 +08:00
parent 5253841acc
commit 7f5ba594a9

View File

@ -65,4 +65,16 @@ end
x = m(x).data
@test x[1] (1 - 0.3) / 1.1449489742783179
end
# with activation function
let m = BatchNorm(2, λ = σ), x = param([1 2; 3 4; 5 6]')
@test m.active
m(x)
testmode!(m)
@test !m.active
x = m(x).data
@test x[1] σ((1 - 0.3) / 1.1449489742783179)
end
end