Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove need for registration mechanisms? #717

Open
dustinvtran opened this issue Jan 31, 2022 · 0 comments
Open

Remove need for registration mechanisms? #717

dustinvtran opened this issue Jan 31, 2022 · 0 comments

Comments

@dustinvtran
Copy link
Member

dustinvtran commented Jan 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant