You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Whether it be tfds' (e.g., replace
tfds.builder('cifar10', ...)
withtfds.image_classification.cifar10(...)
) or our own (e.g., replaceub.models.get('resnet_50', ...)
withub.models.ResNet50(...)
and even remove the registration mechanisms themselves under, say,datasets.py
andmodels.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
The text was updated successfully, but these errors were encountered: