BERT4Rec-VAE-Pytorch icon indicating copy to clipboard operation
BERT4Rec-VAE-Pytorch copied to clipboard

is AverageMeter updating way right?

Open kyeongchan92 opened this issue 2 years ago • 0 comments

Hi, Thank you so much for your code. I got a question about AverageMeter updating way.

It seems that when updating recall or ndcg, in AverageMeterSet.update() and AverageMeter.update(), that instance calculates average with batch average.

for example in Trainer > validate(), test(), batch 1's ndcg = (0.1 + 0.2 + 0.3) / 3 =0.2 if batch size is 3, batch 2's ndcg = (0.4 + 0.5) / 2 = 0.45 if last batch's size is 2 in codes, it seems calculating average like (0.2+0.45) / 2 = 0.325.

but isn't it right like (0.1+0.2+0.3+0.4+0.5) / 5 = 0.3 ?

kyeongchan92 avatar Sep 29 '23 03:09 kyeongchan92