probability icon indicating copy to clipboard operation
probability copied to clipboard

AutoregressiveNetwork cannot be passed to tfa SpectralNormalization

Open anirban-mu opened this issue 3 years ago • 0 comments

If I pass a AutoregressiveNetwork object to a tfa SpectralNormalization layer (https://www.tensorflow.org/addons/api_docs/python/tfa/layers/SpectralNormalization) then I get the following error:

AutoregressiveNetwork object has no attribute 'kernel' nor 'embeddings'

AutoregressiveNetwork has a kernel. As such, it should be straightforward to be able to apply spectral normalisation to the kernel as at its core, an autoregressive network is a feedforward (dense) network with masking and tfa SpectralNormalization is known to work with keras dense layers.

Perhaps, unlike in a dense layer, the kernel of AutoregressiveNetwork is not made available through an attribute called 'kernel'?

Any suggestions on how to proceed would be very much appreciated. To repo, one can add spectral normalisation to any code using AutoregressiveNetwork such as the one here: https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/AutoregressiveNetwork.

anirban-mu avatar Aug 13 '22 08:08 anirban-mu