OK, let's say we have well-labeled images with non-discrete labels such as brightness or size or something and we want to generate images based on it. If it were done with a discrete label it could be done like:

def forward(self, inputs, label):
    self.batch = inputs.size(0)
    h = self.res1(inputs)
    h = self.attn(h)


    h = self.res5(h)
    h = torch.sum((F.leaky_relu(h,0.2)).view(self.batch,-1,4*4), dim=2)
    outputs = self.fc(h)

    if label is not None:
        embed = self.embedding(label)
        outputs += torch.sum(embed*h,dim=1,keepdim=True)

The embedding can be made to match any shape to be added to a hidden layer and summing the embeddings to the latent, which forces the discriminator to recognize the class that's it's discriminating to make a better judgment on the discrimination. That's cool and all, but this method uses embeddings which is the discrete method. How about a continuous label? I can't really find a method for doing this except for some semisupervised methods whereas I have exact labels. Is anyone able to help me?


I think the answer is, you have to either create a very large number of categories, or do it completely differently than with the code I provided. The paper ... https://arxiv.org/pdf/1811.11296.pdf as a good solution to the problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.