Skip to content
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

More efficient projection in svd pullback #755

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Adding a specialized method of svd_rev where only s-bar is nonzero.
The general-case method also works in this case, but is slightly slower because it creates a dense matrix M even though only the diagonal entries are nonzero.
perrutquist committed May 15, 2024
commit 231ac1a0dda79325826e5018ae2dc0711d568b05
5 changes: 5 additions & 0 deletions src/rulesets/LinearAlgebra/factorization.jl
Original file line number Diff line number Diff line change
@@ -273,6 +273,11 @@ function svd_rev(USV::SVD, Ū, s̄, V̄t)
return Ā
end

function svd_rev(USV::SVD, ::AbstractZero, s̄::AbstractVector, ::AbstractZero)
Ā = USV.U * Diagonal(s̄) * USV.Vt
return Ā
end

#####
##### `eigen`
#####