WGAN_weight_clipper: WGAN Weight Clipper

View source: R/value-functions.R

WGAN_weight_clipperR Documentation

WGAN Weight Clipper

Description

A function that clips the weights of a Discriminator (for WGAN training).

Usage

WGAN_weight_clipper(d_net, clip_values = c(-0.01, 0.01))

Arguments

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.

Value

The function modifies the torch::nn_module weights in place


RGAN documentation built on March 30, 2022, 1:07 a.m.