senmaoy / RAT-GAN

A conditional GAN for text-to-image
43 stars 9 forks source link

Pretrain code for #11

Closed YoHoSo closed 1 year ago

YoHoSo commented 1 year ago

Hi, I am following your works and I am wondering if you have the code for pre-training from the paper "3.1 Contrastive Text Embedding Pre-training". In the DAMSM.py file, I saw the CustomLSTM class and the CNN_ENCODER class, I assume they are used to get the sentence-level feature s and the image-level f. I didn't find the pretraining part for the constrastive pre-training. If you have the code, would u mind sharing it? Thanks a lot!

senmaoy commented 1 year ago

Sure, I will upload the pre-training code for contrastive pre-trianing tomorow.

senmaoy commented 1 year ago

Pre-training code is now available at here

YoHoSo commented 1 year ago

Thanks a lot!!

YoHoSo commented 1 year ago

Hi senmaoy, if you don't mind, can you also upload this part of the code? from miscc.losses import sent_loss, words_loss It would be of great help! Thanks a lot!

senmaoy commented 1 year ago

It's herelink. I'm not sure if it works directly, some modification of the dataloader code is neccessary.