Open chengweige opened 3 years ago
Even i had the same problem. I modified the part of the code like this:
for cls_id, nID in self.nID_dict.items():
nID = max(nID, 2) # Added Line
self.emb_scale_dict[cls_id] = math.sqrt(2) * math.log(nID - 1)
But i am not sure if it is the right way. @CaptainEven can you please comment on this.
ThankYou
I see this was opened quite some time ago ;) but I stumbled on the same issue and I'm curious if such assumption of a fixed minimum can in some negative way affect the pipeline.
if only has one id for some class, then raise error
print(cls_id, nID)
self.emb_scale_dict[cls_id] = math.sqrt(2) * math.log(nID - 1)