# Noise with gradient works!

**URL:** <https://discourse.julialang.org/t/noise-with-gradient-works/114178>\
**Category:** General Usage\
**Created:** [May 12, 2024, 9:30pm UTC](https://discourse.julialang.org/t/noise-with-gradient-works/114178 "2024-05-12T21:30:34Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 14, 2024, 9:36am UTC](https://discourse.julialang.org/t/noise-with-gradient-works/114178/24 "2024-05-14T09:36:30Z")

</div>

That may be the case, but as far as I can tell from the repo, CoherentNoise.jl doesn’t include any specific differentiation rules for either ChainRulesCore.jl, ForwardDiff.jl or Enzyme.jl. Nor does its README say anything about differentiability.  
So my point remains: if you differentiate through a function that calls a random sampler, and you don’t use a tool which is _built for that purpose_ (like StochasticAD.jl), you expose yourself to incorrect behavior.  
Also related:

- [Challenges with Zygote Differentiation in Multivariate Mixture Models as input noise of an implicit machine learning method - #8 by gdalle](https://discourse.julialang.org/t/challenges-with-zygote-differentiation-in-multivariate-mixture-models-as-input-noise-of-an-implicit-machine-learning-method/112560/8)

---

_[View the full topic](https://discourse.julialang.org/t/noise-with-gradient-works/114178)._
