Skip to content

Commit

Permalink
set init=0 in stats update
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir committed Sep 30, 2023
1 parent 5b49a64 commit 2ce9c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/normalization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function update_running_stats!(stats::RunningStats, x, μ, σ², reduce_dims::Di
V = eltype(σ²)
momentum = stats.momentum
res_mtm = one(V) - momentum
m = prod(size(x, i) for i in reduce_dims)
m = prod(size(x, i) for i in reduce_dims; init = 1)
correction = m / (m - one(V))

running_mean, running_var = stats.mean, stats.variance
Expand Down

0 comments on commit 2ce9c42

Please sign in to comment.