# Custom regularizer

**URL:** <https://discuss.pytorch.org/t/custom-regularizer/76849>\
**Category:** Uncategorized\
**Created:** [April 15, 2020, 10:16am UTC](https://discuss.pytorch.org/t/custom-regularizer/76849 "2020-04-15T10:16:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 16, 2020, 4:22am UTC](https://discuss.pytorch.org/t/custom-regularizer/76849/2 "2020-04-16T04:22:29Z")

</div>

Would it be possible to calculate a p-norm between the parameters as described [here](https://discuss.pytorch.org/t/how-does-one-implement-weight-regularization-l1-or-l2-manually-without-optimum/7951/2) and add it to your loss?

---

_[View the full topic](https://discuss.pytorch.org/t/custom-regularizer/76849)._
