chilynn / sequence-labeling

307 stars 167 forks source link

A slight modification for random batch generation. #2

Closed Justin1904 closed 4 years ago

Justin1904 commented 7 years ago

Changed the helper.py a little. I imported another package random and used it to create a function distinctRand, which generates a sequence of DISTINCT random integers. This function is further applied to nextBatch and nextRandomBatch to pick random yet distinct examples for the batch. Note that in the original version, random index is chosen one at a time, and at different picks they can be the same, so we could end up having duplicates in our batch which I believe is not ideal. I accidentally made 2 commits but only the latest one is the right one and I don't know how to withdraw the first commit.