Skip to content

Remove need for registration mechanisms? #717

@dustinvtran

Description

@dustinvtran

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions