# Speed up compilation with Zygote and PINN

**URL:** <https://discourse.julialang.org/t/speed-up-compilation-with-zygote-and-pinn/99652>\
**Category:** Machine Learning\
**Created:** [May 31, 2023, 7:43am UTC](https://discourse.julialang.org/t/speed-up-compilation-with-zygote-and-pinn/99652 "2023-05-31T07:43:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![de-souza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/de-souza/32/43417_2.png) [@de-souza](https://discourse.julialang.org/u/de-souza)\
**Post date:** [May 31, 2023, 3:20pm UTC](https://discourse.julialang.org/t/speed-up-compilation-with-zygote-and-pinn/99652/3 "2023-05-31T15:20:06Z")

</div>

Hi,

Based on what was said in a recent topic, I would recommend the approach taken by [TaylorDiff.jl](https://github.com/JuliaDiff/TaylorDiff.jl) for higher order automatic differentiation. See the discussion and links in that topic:

> [@Is it possible to do Nested AD ~elegantly~ in Julia? (PINNs)](https://discourse.julialang.org/t/is-it-possible-to-do-nested-ad-elegantly-in-julia-pinns/98888):
>
> To differentiate a loss function defined in terms of a network’s derivatives seems to have been an issue since forever, specially when Zygote is involved; see [[1]](https://discourse.julialang.org/t/how-to-use-gradient-of-neural-network-as-the-loss-function/50569/11) [[2]](https://discourse.julialang.org/t/current-status-of-nested-ad/70753) [[3]](https://discourse.julialang.org/t/flux-pinn-1d-burgers/93262) and many more over at Zygote’s git. In many of these threads (specially pre 2022) it is said that [the release of Diffractor.jl would correct this issue](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525/3). Now that it seems that [Diffractor is mostly dead](https://discourse.julialang.org/t/state-of-diffractor-jl/92959), what is left? In my case, because I am working with exotic architectures, it is not possible to use @ChrisRackauckas’s Neura…

---

_[View the full topic](https://discourse.julialang.org/t/speed-up-compilation-with-zygote-and-pinn/99652)._
