yueyericardo/pkbar

Can you provide an example how to use it using `stateful metrics`?

Closed this issue · 3 comments

Nice code, thanks. Could you provide an example how to display metrics as it is (no average)? Thanks

Hi,

The Kbar's code is taken directly from tf.keras.utils.Progbar.
And it does not support stateful metrics.

I will try to add this feature when I find some time.

After reading your code, I understand how to use stateful_metrics. Just pass variables you dont want to take the average to param stateful_metrics and you will get values as it is (no avg). This is my example:
Declaration:
kbar = pkbar.Kbar(target=len(data_loader), width=8, stateful_metrics=['loss','top1','top5'])

Update progbar:
kbar.update(i, values=[('batch_time', batch_time.val), ('loss', losses.avg), ('top1', top1s.avg), ('top5', top5s.avg)])

I like your work, thanks!

After reading your code, I understand how to use stateful_metrics. Just pass variables you dont want to take the average to param stateful_metrics and you will get values as it is (no avg). This is my example:
Declaration:
kbar = pkbar.Kbar(target=len(data_loader), width=8, stateful_metrics=['loss','top1','top5'])

Update progbar:
kbar.update(i, values=[('batch_time', batch_time.val), ('loss', losses.avg), ('top1', top1s.avg), ('top5', top5s.avg)])

I like your work, thanks!

Oh, cool, I didn’t use stateful metrics before, and thought needs to modify the code.

Thanks!