@@ -39,8 +39,8 @@ _apply_scale_bias(x, scale, bias) = x .* scale .+ bias
39
39
40
40
Shared code path for all built-in norm functions.
41
41
42
- `μ` and `σ²` should be calculated on the fly using [`NNlib. norm_stats`](@ref),
43
- or extracted from an existing collection such as [`NNlib. RunningStats`](@ref).
42
+ `μ` and `σ²` should be calculated on the fly using [`norm_stats`](@ref),
43
+ or extracted from an existing collection such as [`RunningStats`](@ref).
44
44
`bias` and `scale` are consistent with cuDNN and Flux.Scale.
45
45
We opt for `scale` over `weight` to avoid confusion with dense layers.
46
46
If the size of the statistics and affine parameters differ,
@@ -64,7 +64,7 @@ Contains running mean and variance estimates for stateful norm functions.
64
64
If the parameters are mutable, they will be updated in-place.
65
65
Otherwise, they will be replaced wholesale.
66
66
67
- See also [`NNlib. update_running_stats!`](@ref).
67
+ See also [`update_running_stats!`](@ref).
68
68
"""
69
69
mutable struct RunningStats{M <: AbstractArray , V <: AbstractArray , MT <: Real }
70
70
mean:: M
@@ -114,10 +114,10 @@ end
114
114
reduce_dims) where {N}
115
115
116
116
Performs a moving average update for layers with tracked statistics.
117
- `μ` and `σ²` are the sample mean and variance, most likely from [`NNlib. norm_stats`](@ref).
118
- `reduce_dims` should also match the `dims` argument of [`NNlib. norm_stats`](@ref).
117
+ `μ` and `σ²` are the sample mean and variance, most likely from [`norm_stats`](@ref).
118
+ `reduce_dims` should also match the `dims` argument of [`norm_stats`](@ref).
119
119
120
- See also [`NNlib. RunningStats`](@ref).
120
+ See also [`RunningStats`](@ref).
121
121
"""
122
122
function update_running_stats! (stats:: RunningStats , x, μ, σ², reduce_dims:: Dims )
123
123
V = eltype (σ²)
@@ -153,7 +153,7 @@ Normalizes `x` along the first `S` dimensions.
153
153
154
154
For an additional learned affine transform, provide a `S`-dimensional `scale` and `bias`.
155
155
156
- See also [`NNlib. batchnorm`](@ref), [`NNlib. instancenorm`](@ref), and [`NNlib. groupnorm`](@ref).
156
+ See also [`batchnorm`](@ref), [`instancenorm`](@ref), and [`groupnorm`](@ref).
157
157
158
158
# Examples
159
159
@@ -190,14 +190,14 @@ Functional [Batch Normalization](https://arxiv.org/abs/1502.03167) operation.
190
190
Normalizes `x` along each ``D_1×...×D_{N-2}×1×D_N`` input slice,
191
191
where `N-1` is the "channel" (or "feature", for 2D inputs) dimension.
192
192
193
- Provide a [`NNlib. RunningStats`](@ref) to fix a estimated mean and variance.
193
+ Provide a [`RunningStats`](@ref) to fix a estimated mean and variance.
194
194
`batchnorm` will renormalize the input using these statistics during inference,
195
195
and update them using batch-level statistics when training.
196
196
To override this behaviour, manually set a value for `training`.
197
197
198
198
If specified, `scale` and `bias` will be applied as an additional learned affine transform.
199
199
200
- See also [`NNlib. layernorm`](@ref), [`NNlib. instancenorm`](@ref), and [`NNlib. groupnorm`](@ref).
200
+ See also [`layernorm`](@ref), [`instancenorm`](@ref), and [`groupnorm`](@ref).
201
201
"""
202
202
function batchnorm (x:: AbstractArray{<:Any, N} ,
203
203
running_stats:: Union{RunningStats, Nothing} = nothing ,
@@ -232,7 +232,7 @@ To override this behaviour, manually set a value for `training`.
232
232
233
233
If specified, `scale` and `bias` will be applied as an additional learned affine transform.
234
234
235
- See also [`NNlib. layernorm`](@ref), [`NNlib. batchnorm`](@ref), and [`NNlib. groupnorm`](@ref).
235
+ See also [`layernorm`](@ref), [`batchnorm`](@ref), and [`groupnorm`](@ref).
236
236
"""
237
237
function instancenorm (x:: AbstractArray{<:Any, N} ,
238
238
running_stats:: Union{RunningStats, Nothing} = nothing ,
@@ -266,7 +266,7 @@ The number of channels must be an integer multiple of the number of groups.
266
266
267
267
If specified, `scale` and `bias` will be applied as an additional learned affine transform.
268
268
269
- See also [`NNlib. layernorm`](@ref), [`NNlib. batchnorm`](@ref), and [`NNlib. instancenorm`](@ref).
269
+ See also [`layernorm`](@ref), [`batchnorm`](@ref), and [`instancenorm`](@ref).
270
270
271
271
# Examples
272
272
0 commit comments