Before this PR, we had to compute triplets on the fly to obtain a training sample, slowing down training and making the GPU wait for data.
This PR makes an improvement to TripletDataset by pre-computing triplets before training the model and giving up to 6 times faster training speed. This way, obtaining a training sample to create batches is almost instant. However, with this improvement, each anchor has only one corresponding positive and negative example in every epoch.
Before this PR, we had to compute triplets on the fly to obtain a training sample, slowing down training and making the GPU wait for data. This PR makes an improvement to
TripletDataset
by pre-computing triplets before training the model and giving up to 6 times faster training speed. This way, obtaining a training sample to create batches is almost instant. However, with this improvement, each anchor has only one corresponding positive and negative example in every epoch.