tensorflow / tensorflow/probability

AutoregressiveNetwork cannot be passed to tfa SpectralNormalization

Open
#1,601 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the AutoregressiveNetwork and tfa SpectralNormalization API documentation, then reproduce the error using the linked TensorFlow Probability example. Trace how SpectralNormalization looks for a kernel or embeddings attribute; done means an AutoregressiveNetwork can be passed to the layer without the reported attribute error.

Written by the indexing model from the issue text.

Assessment

Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.