-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
Problem
We currently store the metrics as a simple dictionary metric
-> value
. For classification weights this looks like this:
vision/torchvision/models/resnet.py
Lines 320 to 323 in 7d0d7fd
"metrics": { | |
"acc@1": 69.758, | |
"acc@5": 89.078, | |
}, |
and the underlying assumption is that the dataset is ImageNet.
But in the future, we might want to provide metrics for more than one dataset, not just ImageNet. Our current schema doesn't allow us to do that nicely. In fact we already have such an problem with the Optical Flow weights, which typically report EPE on different datasets, and keys of the metrics
dict currently look like:
sintel_train_cleanpass_epe
sintel_train_finalpass_epe
sintel_test_cleanpass_epe
sintel_test_finalpass_epe
which is pretty ugly.
Proposed schema
There's a million ways to structure this. I guess the simplest one is to have a metrics
dict with such structure:
"metrics": {
"ImageNet": {
"acc@1": 69.758,
"acc@5": 89.078,
},
"ImageNetV2": {
"acc@1": 99.999,
"acc@5": 0.0001,
},
},
This makes it slightly less convenient to access values programatically, but I'm wondering whether this is actually something we should encourage?
I'm almost tempted to rename the "metrics"
key of the meta dict into "_metrics"
to strongly discourage users to use it, and to allow us to change the schema in the future if we find a need for it. Happy to hear your thoughts