Skip to content

Commit

Permalink
use max rather than maximum to decide if need to use epislon (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox authored Jul 15, 2021
1 parent 2c192ec commit 1d62a2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ function _apply(A::AbstractArray, scaling::MeanStdScaling; inverse=false, eps=1e
# Avoid division by 0
# If std is 0 then data was uniform, so the scaled value would end up ≈ 0
# Therefore the particular `eps` value should not matter much.
σ_safe = maximum([scaling.σ, eps])
σ_safe = max(scaling.σ, eps)
return (A .- scaling.μ) ./ σ_safe
end

0 comments on commit 1d62a2a

Please sign in to comment.