Using a discriminator for generating similar outputs

Hello All,

I am currently trying to train a 2 encoders/generators so that they generate similar outputs. Each generator generates 2 different outputs, so in total I have 4 different generated outputs that I want to constrain to be similar. I had the idea to use a discriminator to constrain the generators in an adversarial training scheme (GAN). I wanted train the adversarial process so that the generators are trained to generate 4 different outputs that the discriminator fails to differentiate. Since a discriminator is essentially a classifier, I thought I could just implement a 4-class classifier with a softmax output layer where each of the 4 outputs’ true label is [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0], [1, 0, 0, 0]. So the goal of the discriminator would be to correctly classify the correct label given one of the generated outputs. On the other hand, the generator would be trained so that the discriminator’s output is [0.25, 0.25, 0.25, 0.25], i.e. a random guess. I have implemented this using the nn.CrossEntropyLoss. However, the model would never converge and the loss would not decrease. Does anyone have any advice that they could provide me? Should I not be using the CrossEntropyLoss and use a BCEWithLogitsLoss? If so, what would the “fake” label be? I was thinking maybe [0,0,0,0], but then that is not necessarily a “random” guess no?