# Gradient calculation in PINN

**URL:** <https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525>\
**Category:** General Usage\
**Tags:** flux, zygote\
**Created:** [May 20, 2021, 3:48pm UTC](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525 "2021-05-20T15:48:12Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 2, 2021, 5:08pm UTC](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525/3 "2021-06-02T17:08:05Z")

</div>

The right answer is Diffractor, or to use the modified getindex gradients of Flux. NeuralPDE.jl uses some tricks in the meantime.

---

_[View the full topic](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525)._
