sakura.utils.gradient_reverse

Gradient reversal layer for pytorch module

Reference:

Adapted from https://github.com/janfreyberg/pytorch-revgrad/blob/master/src/pytorch_revgrad/functional.py

Classes

NeutralizeLayerF

Custom autograd Function that nullifies gradients during backward pass

ReverseLayerF

Custom autograd class that reverses and scales gradients during backward pass