-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Remove greek-letter keyword arguments #2139
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,12 @@ end | |
_check_sizes(ŷ, y) = nothing # pass-through, for constant label e.g. y = 1 | ||
|
||
ChainRulesCore.@non_differentiable _check_sizes(ŷ::Any, y::Any) | ||
|
||
# Greek-letter keywords deprecated in Flux 0.13 | ||
# Arguments (old => new, :function, "β" => "beta") | ||
function _greek_ascii_depwarn(βbeta::Pair, func = :loss, names = "" => "") | ||
Base.depwarn("""loss function $func no longer accepts greek-letter keyword $(names.first) | ||
please use ascii $(names.second) instead""", func) | ||
βbeta.first | ||
end | ||
_greek_ascii_depwarn(βbeta::Pair{Nothing}, _...) = βbeta.second | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this live outside of the Losses module? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may want to make it non-differentiable as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could live somewhere else, but where? And is it worth it? (Most uses are in Losses, I spotted the normalisation ones afterwards, just 3.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. utils.jl? That's included before any layers or loss functions are defined. |
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 PR does not remove
initβ, initγ
. IMO they should be replaced with a method where you pass in aScale
layer. But perhaps better part of an overhaul of norm layers.Getting rid of greek-letter field names may also be a good idea. The norm layers are the worst offenders.
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.
We can tackle this as part of a bigger rework of norm layer internals to save on some churn.