Skip to content

Remove type restrictions on normalization layers' scale and bias #2099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/layers/normalise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ julia> isapprox(std(m(xs)), 1, atol=0.1) && std(xs) != std(m(xs))
true
```
"""
mutable struct BatchNorm{F,V,N,W}
mutable struct BatchNorm{F,B,S,N,W}
λ::F # activation function
β::V # bias
γ::V # scale
β::B # bias
γ::S # scale
μ::W # moving mean
σ²::W # moving var
ϵ::N
Expand Down Expand Up @@ -412,10 +412,10 @@ julia> isapprox(std(y, dims=1:2), ones(1, 1, 3, 2), atol=0.2) && std(y, dims=1:2
true
```
"""
mutable struct InstanceNorm{F,V,N,W}
mutable struct InstanceNorm{F,B,S,N,W}
λ::F # activation function
β::V # bias
γ::V # scale
β::B # bias
γ::S # scale
μ::W # moving mean
σ²::W # moving var
ϵ::N
Expand Down Expand Up @@ -510,11 +510,11 @@ julia> isapprox(std(y[:, :, 3:4, 2]), 1, atol=0.1) && std(xs[:, :, 3:4, 2]) != s
true
```
"""
mutable struct GroupNorm{F,V,N,W}
mutable struct GroupNorm{F,B,S,N,W}
G::Int # number of groups
λ::F # activation function
β::V # bias
γ::V # scale
β::B # bias
γ::S # scale
μ::W # moving mean
σ²::W # moving std
ϵ::N
Expand Down