question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC on schema for the `metrics` field of weights meta-data

See original GitHub issue

Problem

We currently store the metrics as a simple dictionary metric -> value. For classification weights this looks like this:

https://github.com/pytorch/vision/blob/7d0d7fd7a940df94a12e9c1853eec7e42ab6ee80/torchvision/models/resnet.py#L320-L323

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasHugcommented, May 19, 2022

I don’t have a strong opinion.

At this point my preferred solution would actually to not use - or _, but instead write purely human-readable dataset names like ImageNet 1K or Sintel (test), clean pass. It would make it a bit more awkward to access programmatically by users, which IMHO is a good thing.

But again, no strong opinion. Using - vs _ feels the same to me, so if you submit a PR I’ll approve it.

1reaction
datumboxcommented, May 17, 2022

I’m OK adopting @NicolasHug proposal. I don’t think it’s necessary to specify a default dataset or a default value. I would be more inclined to keep the metrics public thought as it would be useful for downstream projects (Papers with code repo, D2go Zoo, etc) to programmatically read the values but I’m OK if we want to release it first as private until we are certain about the schema.

@NicolasHug are you unblocked to implement your proposal?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capability Property Schemas Reference | Alexa Skills Kit
Indicates a quantity as a unit of weight or mass in one of several different standard units. Can be a descendant type of...
Read more >
Schema metadata RFC · Issue #4599 · vectordotdev/vector
As a first step towards supporting various schemas, we want to shift the event metadata into a Vector specific namespace.
Read more >
RFC 9065 - Considerations around Transport Header ...
Considerations around Transport Header Confidentiality, Network Operations, and the Evolution of Internet Transport Protocols (RFC 9065, July 2021)
Read more >
Field Reference - The workflow engine for Kubernetes
Servers should convert recognized schemas to the latest internal value, ... metrics, Metrics, Metrics are a list of metrics emitted from this Workflow....
Read more >
NetSuite Applications Suite - RFC Field - Oracle Help Center
RFC. Enter the entity's registered Mexican tax ID number in the Tax Registration Number field, under the Financial > Tax Registrations subtab.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found