Open Thangbluee opened 3 years ago
@Thangbluee I have the same question as you, triplet Loss is not used in the code. What parameters need to be adjusted if triplet Loss is used. Thanks!
@Thangbluee you can modify loss parameter in torchreid.models.build_model like this one "example"
model = torchreid.models.build_model( name = 'osnet_x0_5', num_classes = datamanager.num_train_pids, loss = 'triplet', pretrained = True )
and also add engine relate this loss
engine = torchreid.engine.ImageTripletEngine( datamanager, model, optimizer, margin=0.3, weight_t=0.7, weight_x=1, scheduler=scheduler
Many thanks to all the contributors for this project.
In your paper https://arxiv.org/pdf/1905.00953.pdf you use the cross-entropy loss as the main objective and the triplet loss as an auxiliary loss with a balancing weight (which needs to be tuned) to get the result showed in table 12e. How can I apply this auxiliary loss to train the model. Thanks!