Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nn_utils_clip_grad_value_

Clips gradient of an iterable of parameters at specified value.


Description

Gradients are modified in-place.

Usage

nn_utils_clip_grad_value_(parameters, clip_value)

Arguments

parameters

(Iterable(Tensor) or Tensor): an iterable of Tensors or a single Tensor that will have gradients normalized

clip_value

(float or int): maximum allowed value of the gradients.

Details

The gradients are clipped in the range ≤ft[\mbox{-clip\_value}, \mbox{clip\_value}\right]


torch

Tensors and Neural Networks with 'GPU' Acceleration

v0.3.0
MIT + file LICENSE
Authors
Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.