-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add rrule for infinite-norm #204
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current
rrule
fornorm
fails whenp=Inf
, for which the norm is equivalent tomaximum(abs, x)
:This really just fails for any very large
p
(e.g. also fails forp=1e3
). It works fine forp=100
:The actual implementation of
norm
in LinearAlgebra special-casesp
of 0, 1, 2,-Inf
, andInf
, falling back tonormp
if anotherp
is provided (see https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/generic.jl#L604-L619). Should therrule
fornorm
here instead be replaced byrrules
for these functions? I see 2 downsides: 1) more code 2) pullback ofp
for these specialp
's would beZero()
, and in general would not be type-stable when pulling back throughnorm
.On the upside, the pullbacks for these types can be implemented a little more efficiently.
The text was updated successfully, but these errors were encountered: