WGAN_weight_clipper {RGAN} | R Documentation |
A function that clips the weights of a Discriminator (for WGAN training).
WGAN_weight_clipper(d_net, clip_values = c(-0.01, 0.01))
d_net |
A torch::nn_module (typically a discriminator/critic) for which the weights should be clipped |
clip_values |
A vector with the lower and upper bound for weight values. Any value outside this range will be set to the closer value. |
The function modifies the torch::nn_module weights in place