Implementation of Spectral Normalization for Machine Learning

The problem is that there is currently no rrule defined for svdvals.
A workaround would be to define:

function snorm(X)
    return svd(X).S[1]
end

Which does a full svd (for which there is an rrule defined)

1 Like