NVlabs / DG-Net

:couple: Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral) :couple:
https://www.zdzheng.xyz/publication/Joint-di2019
Other
1.27k stars 230 forks source link

doubt about a loss in the ‘gen_update’ #63

Closed 5Yesterday closed 3 years ago

5Yesterday commented 3 years ago
    elif hyperparameters['ID_style'] == 'AB':
        weight_B = hyperparameters['teacher_w'] * hyperparameters['B_w']
        self.loss_id = self.id_criterion(p_a[0], l_a) + self.id_criterion(p_b[0], l_b) \
                       + weight_B * (self.id_criterion(p_a[1], l_a) + self.id_criterion(p_b[1], l_b))

when 'AB', the weight_B control the loss, compare to 'PCB', 'normal', I don't know it how to work.

layumi commented 3 years ago

Hi @5Yesterday Sorry for the late response. weight_B is to progressively increase to B_w. Since we want to warm up the network, we directly multiply hyperparameters['teacher_w']. https://github.com/NVlabs/DG-Net/blob/c0ee2dff34662b10e904eb08249c14661f2306b1/trainer.py#L493 We do not use 'normal' and 'PCB', and just left the api for further research.

5Yesterday commented 3 years ago

@layumi Thank for your reply.