Merge pull request #391 from jekbradbury/normalise-1

1.0 compat for `normalise`
This commit is contained in:
Mike J Innes 2018-09-07 11:01:23 +01:00 committed by GitHub
commit b93d4763cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ logitbinarycrossentropy(logŷ, y) = (1 - y)*logŷ - logσ(logŷ)
Normalise each column of `x` to mean 0 and standard deviation 1.
"""
function normalise(x::AbstractVecOrMat)
μ′ = mean(x, 1)
σ = std(x, 1, mean = μ′)
μ′ = mean(x, dims = 1)
σ = std(x, dims = 1, mean = μ′)
return (x .- μ′) ./ σ
end