I am applying the paper of Semi-supervised Learning with Deep Generative models.
Here is the problem, i have a classifier, who produce a softmax probability (10 dimension vector for 10 classes), so for every class, i need to embed to onehot version vector into the decoder model. The model is a little complicated, so here i put the simply version of it.
x = Input((batch,784)) # this the mnist data input
z = encoder(x) # encoder model to produce latent variable z
c = classifier(x) # classifier to produce softmax probability for digit 0-9
onehot # this is onthot tensor with dimension of 10 by 10
for i in range(10):
f_x(i) = decoder(z, onehot(i)) # here we put different onehot into the network
then we calculate the loss for 10 different classes and total loss will be:
K.sum(c * losses)
So, we problem is for the decoder part, my input of onehot always cause problem of no keras history.
and i also try decoder(z, Input(tensor=onehot(i)) but it says graph disconnected, so can anyone help me with this problem?
Hi all,
I am applying the paper of Semi-supervised Learning with Deep Generative models.
Here is the problem, i have a classifier, who produce a softmax probability (10 dimension vector for 10 classes), so for every class, i need to embed to onehot version vector into the decoder model. The model is a little complicated, so here i put the simply version of it.
x = Input((batch,784)) # this the mnist data input z = encoder(x) # encoder model to produce latent variable z c = classifier(x) # classifier to produce softmax probability for digit 0-9 onehot # this is onthot tensor with dimension of 10 by 10 for i in range(10): f_x(i) = decoder(z, onehot(i)) # here we put different onehot into the network then we calculate the loss for 10 different classes and total loss will be: K.sum(c * losses)
So, we problem is for the decoder part, my input of onehot always cause problem of no keras history. and i also try decoder(z, Input(tensor=onehot(i)) but it says graph disconnected, so can anyone help me with this problem?
Best wishes,
Chen