RPIN icon indicating copy to clipboard operation
RPIN copied to clipboard

fix wrongly printed seq_loss

Open ZhiyuanChen opened this issue 2 years ago • 6 comments

ZhiyuanChen avatar May 04 '22 23:05 ZhiyuanChen

why is it wrong?

HaozhiQi avatar May 05 '22 00:05 HaozhiQi

If you would like a batch stat (the same as p1, p2, s1, s2, m1, m2), it should have been = If you would like the overall stat (the same as accuracy for bg and fg), an AverageMeter is usually needed Simply adding loss could ends up with terrifying resules

ZhiyuanChen avatar May 05 '22 15:05 ZhiyuanChen

I want overall stat. p1, p2, s1, s2, m1, m2 are also overall stat. https://github.com/HaozhiQi/RPIN/blob/master/rpin/trainer.py#L176-L180

Is there any difference between the current implementation and AverageMeter? It looks like the AverageMeter also simply adding losses. Is there anything I missed?

HaozhiQi avatar May 05 '22 16:05 HaozhiQi

I want overall stat. p1, p2, s1, s2, m1, m2 are also overall stat. https://github.com/HaozhiQi/RPIN/blob/master/rpin/trainer.py#L176-L180

Is there any difference between the current implementation and AverageMeter? It looks like the AverageMeter also simply adding losses. Is there anything I missed?

The key of average meter is to divide current value by batch_size. The accuracy part is correct, as batch_size is in both denominator (xg_sum) and numerator (xg_correct).

ZhiyuanChen avatar May 05 '22 16:05 ZhiyuanChen

Also.... Since it's a binary classification problem, can I ask why accuracy on both tp and fn are used instead of metrics like auroc, auprc, f1?

ZhiyuanChen avatar May 05 '22 17:05 ZhiyuanChen

I want overall stat. p1, p2, s1, s2, m1, m2 are also overall stat. https://github.com/HaozhiQi/RPIN/blob/master/rpin/trainer.py#L176-L180 Is there any difference between the current implementation and AverageMeter? It looks like the AverageMeter also simply adding losses. Is there anything I missed?

The key of average meter is to divide current value by batch_size. The accuracy part is correct, as batch_size is in both denominator (xg_sum) and numerator (xg_correct).

Sorry I still can't understand it. The average meter divides the (sum loss) by the (sum batch size) of a few iterations, which is what I did (see sum of loss, sum of batch size), and sum of loss divides sum of batch size.


Also.... Since it's a binary classification problem, can I ask why accuracy on both tp and fn are used instead of metrics like auroc, auprc, f1?

There is no particular reason of using accuracy v.s. other metrics. This is just used for monitoring the training. The actual evaluation protocal (reported in paper) is followed by the PHYRE benchmark, and evaluation during training my just be very slow.

HaozhiQi avatar May 06 '22 04:05 HaozhiQi

i'll close this since it's inactive for 3 months. feel free to reopen if needed.

HaozhiQi avatar Aug 20 '22 22:08 HaozhiQi