google / google/uncertainty-baselines

Remove need for registration mechanisms?

Open
#717 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.6k
Forks
224
Avg merge
15h 36m
Merged PRs (30d)
2

Description

Whether it be tfds' (e.g., replace `tfds.builder('cifar10', ...)` with `tfds.image_classification.cifar10(...)`) or our own (e.g., replace `ub.models.get('resnet_50', ...)` with `ub.models.ResNet50(...)` and even remove the registration mechanisms themselves under, say, `datasets.py` and `models.py`).

Registration mechanisms appear quite a bit in ML libraries. Their main purpose is to be easily varied under commandline/config flags where you can just change a different string. IMO modern tooling like ml_collection's config dict obviates the need for string arguments as you can execute arbitrarily complicated code as part of that config (it's all Python). In contrast, passing `'func(some_arg1=5, some_arg2=3)'` leads to two major issues: (1) parsing indirection (2) unclear dependencies where you may need to import a module in order to register a custom dataset but that module is never directly used.

Curious what folks' thoughts are on this!

context: @BlackHC @y0ast @zi-w from chatting

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.