deep-person-reid icon indicating copy to clipboard operation
deep-person-reid copied to clipboard

Auxiliary loss

Open Thangbluee opened this issue 3 years ago • 2 comments

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!

Thangbluee avatar Oct 26 '21 01:10 Thangbluee

@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!

buaa-luzhi avatar Nov 26 '21 03:11 buaa-luzhi

@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

LamnouarMohamed avatar Nov 29 '21 12:11 LamnouarMohamed