What tensorflow distribution to represent a list of categorical data
Does tf.contrib.distributions.Categorical satisfy your needs? Samples should be from (0 to n - 1), where n represents the category.
Example:
# logits has shape [N, M], where M is the number of classes
dist = tf.contrib.distributions.Categorical(logits=logits) 
# Sample 20 times. Should give shape [20, N].
samples = dist.sample(20)
# depth is the number of categories.
one_hots = tf.one_hot(samples, depth=M)
I want to construct a variational autoencoder where one sample is an N*M matrix where for each row, there are M categories. Essentially one sample is a list of categorical data where only one category can be selected - a list of one-hot vectors.
Currently, I have a working autoencoder for this type of data - I use a softmax on the last dimension to create this constraint and it works (reconstruction cross entropy is low).
Now, I want to use tf.distributions to create a variational autoencoder. I was wondering what kind of distribution would be appropriate.