tensorflow / tensorflow/probability
NotImplementedError with tensorflow_probability.layers.IndependentNormal
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Please see MWE below. The code gives a NotImplementedError after outputs = tfpl.IndependentNormal(event_shape = encoded_shape) (layer3). The model, however, is constructed correctly. This issue was originally raised in the corresponding downstream R library: https://github.com/rstudio/tfprobability/issues/139.
import tensorflow as tf
import tensorflow_probability as tfp
tfkl = tf.keras.layers
tfpl = tfp.layers
input_shape = [28, 28, 1]
encoded_shape = 2
inputs = tf.keras.Input(shape=input_shape)
layer1 = tfkl.Flatten()(inputs)
layer2 = tfkl.Dense(units=10)(layer1)
layer3 = tfkl.Dense(units=tfpl.IndependentNormal.params_size(encoded_shape)) (layer2)
outputs = tfpl.IndependentNormal(event_shape = encoded_shape) (layer3)
model=tf.keras.Model(inputs, outputs)
model.summary()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Python MWE and inspect the tensorflow_probability.layers.IndependentNormal entry point, especially the call after Dense.params_size(encoded_shape). Done means the model can be constructed and summarized without the reported NotImplementedError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100