glow-pytorch
glow-pytorch copied to clipboard
How to learn y condition?
Thanks for your great implementation.
The learned prior are added in every block in your implementation, which produces more promising results, however, the original implementation adds the prior only at the end of the glow,
your prior original prior and the location of prior usage
Could you please provide an example or tell me how to learn the y condition (image label)?
Thanks again!
I added priors in every blocks because of split2d_prior in this lines: https://github.com/openai/glow/blob/eaff2177693a5d84a1cf8ae19e8e0441715b82f8/model.py#L551
I think easy way to use class conditions is use class labels as an additional inputs is NN of affine coupling layers: https://github.com/rosinality/glow-pytorch/blob/4d4a69400df5f07aa947ea809802803bd9209cb6/model.py#L162
Following @rosinality's advice, it works with label conditioning on MNIST.
I added a label conditioning to the affine coupling layers instead of the prior (this is good because the net in this layer doesn't interfere with the invertibility of the model).
I also added a classifier working on the forward pass of the model. This classifies the final latent vector output and the logits are compared with the labels in a loss term added to the total original loss.
Thanks again @rosinality :)
(these are some samples with a shallow model with minimal filters in the coupling net)
@hologerry Can you share the codes? Thank you very much!
@hologerry Can you share the codes about y condition? Thank you very much!
@hologerry Can you share the codes about y condition? Thank you very much!
Hi, do you solve the problem? Can you share the codes about y condition? Thank you very much!