Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created April 19, 2022 08:32
Show Gist options
  • Save ntakouris/b4436603f740acada6bc208a70fc377a to your computer and use it in GitHub Desktop.
Save ntakouris/b4436603f740acada6bc208a70fc377a to your computer and use it in GitHub Desktop.
class Scopes:
Training = "train"
Validation = "val"
Test = "test"
# support multiple experiment types and structures with ease
class Metrics:
Loss = "loss"
class ObjectDetection:
tag_name = "det"
MeanAveragePrecision = "mAP"
class Classification:
tag_name = "cls"
Top1Accuracy = "Accuracy@1"
# if you want to do dynamic things
# like scoped(Metrics.Loss, Scopes.Training, Metrics.ObjectDetection.tag_name)
def scoped(metric: str, *scopes):
return "/".join(scopes) + f"/{metric}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment