type4py icon indicating copy to clipboard operation
type4py copied to clipboard

Pre-computing triplets in `TripletDataset`

Open mir-am opened this issue 2 years ago • 0 comments

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.

mir-am avatar May 20 '22 09:05 mir-am