# Does the singular value degeneracy cause the gradient to be NAN？

**URL:** <https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412>\
**Category:** General Usage\
**Tags:** question, zygote, svd\
**Created:** [August 27, 2022, 3:57am UTC](https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412 "2022-08-27T03:57:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [August 28, 2022, 3:33pm UTC](https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412/6 "2022-08-28T15:33:19Z")

</div>

I haven’t read the entire discussion, but for differentiating linear algebra routines, there is the package

> **[GitHub - JuliaLinearAlgebra/GenericLinearAlgebra.jl: Generic numerical linear...](https://github.com/JuliaLinearAlgebra/GenericLinearAlgebra.jl)**
>
> Generic numerical linear algebra in Julia. Contribute to JuliaLinearAlgebra/GenericLinearAlgebra.jl development by creating an account on GitHub.

which provides pure Julia implementations of everything, so that Zygote can differentiate it.

See for example: [Does svd() not support forwarddiff? - #3 by maxkapur](https://discourse.julialang.org/t/does-svd-not-support-forwarddiff/84662/3)

---

_[View the full topic](https://discourse.julialang.org/t/does-the-singular-value-degeneracy-cause-the-gradient-to-be-nan/86412)._
