keras-io icon indicating copy to clipboard operation
keras-io copied to clipboard

VQ-VAE inference on trained prior

Open lb-97 opened this issue 2 years ago • 1 comments
trafficstars

After training prior with PixelCNN, during inference probabilities of codebook indices are calculated. There's a distribution sampler used to pick/sample a index instead of choosing the highest probability index-

outputs = pixel_cnn(inputs, training=False)
categorical_layer = tfp.layers.DistributionLambda(tfp.distributions.Categorical)
outputs = categorical_layer(outputs)

Why is that so? Why use this sampler? Is this distribution what makes the PixelCNN model generative? On removing this distribution sampler, the model is deterministic as it's just a bunch of convolutional layers. Can someone kindly explain the necessity of these lines of code?

lb-97 avatar Jun 02 '23 04:06 lb-97

@fchollet, can you please explain. Thankyou.

lb-97 avatar Jun 02 '23 04:06 lb-97