# How to add norm of gradient to a loss function?

**URL:** <https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873>\
**Category:** Machine Learning\
**Tags:** flux, zygote\
**Created:** [October 16, 2021, 2:08am UTC](https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873 "2021-10-16T02:08:17Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [October 27, 2021, 12:07am UTC](https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873/13 "2021-10-27T00:07:45Z")

</div>

As always, please include a [full stacktrace](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) along with your MWE.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873)._
