You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a list of triplets, you need to define a dataset for them. You can refer to thesetwo examples to get an idea of how to define custom datasets. Once that is done, you can setup a dataloader for this dataset, and use it in your training loop. You can use torch.nn.TripletMarginLoss for the loss function.
However, if you are using training.pass_epoch, do note that it expects to unpack a batch of single images at a time (see this). You will have to modify it to unpack a batch of tuple of three images and evaluate each image on the model individually, before passing on to the loss function.
Can you leave an example of how to do finetuning with triplet loss?
The text was updated successfully, but these errors were encountered: