# Hidden units saturate in a seq2seq model in PyTorch

**URL:** <https://discuss.pytorch.org/t/hidden-units-saturate-in-a-seq2seq-model-in-pytorch/8964>\
**Category:** Uncategorized\
**Created:** [October 23, 2017, 7:47am UTC](https://discuss.pytorch.org/t/hidden-units-saturate-in-a-seq2seq-model-in-pytorch/8964 "2017-10-23T07:47:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dhpollack](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/dhpollack/32/1317_2.png) [@dhpollack](https://discuss.pytorch.org/u/dhpollack)\
**Post date:** [October 25, 2017, 5:15pm UTC](https://discuss.pytorch.org/t/hidden-units-saturate-in-a-seq2seq-model-in-pytorch/8964/3 "2017-10-25T17:15:01Z")

</div>

> [@Proper way to do gradient clipping?](https://discuss.pytorch.org/t/proper-way-to-do-gradient-clipping/191/13):
>
> for people trying to just get an answer quickly: torch.nn.utils.clip\_grad\_norm(mdl\_sgd.parameters(),clip) or with in-place clamp: W.grad.data.clamp\_(-clip,clip) also similar Q:

Perhaps try this

---

_[View the full topic](https://discuss.pytorch.org/t/hidden-units-saturate-in-a-seq2seq-model-in-pytorch/8964)._
