-
-
Notifications
You must be signed in to change notification settings - Fork 611
Allow user to change the channel axis for BatchNorm function and the likes #1666
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
base: master
Are you sure you want to change the base?
Conversation
@@ -243,9 +245,11 @@ mutable struct BatchNorm{F,V,N,W} | |||
track_stats::Bool | |||
active::Union{Bool, Nothing} | |||
chs::Int # number of channels | |||
dim::Union{Int, Nothing} # channel dimension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should never be nothing
, but use N - 1
as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you know N - 1
a priori though? The question is what is an appropriate sentinel value. Perhaps a negative offset from the end, since by default channels are at dim end - 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right so, it will need to be defined at runtime.
How well is cudnn able to handle this? |
Looping back to answer the cuDNN question: it supports one other configuration for channel dim via |
Proposition for issue #1664
This PR allows the user to customize the channel axis for normalisation functions (
BatchNorm
,GroupNorm
andInstanceNorm
).Example