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

[FEATURE]: Experiment Config Override Support & Custom Code Registry #24

Closed
nmichlo opened this issue Feb 5, 2022 · 3 comments
Closed
Labels
documentation Improvements or additions to documentation enhancement New feature or request refactoring Internal changes to the code that do not change the outputs.
Milestone

Comments

@nmichlo
Copy link
Owner

nmichlo commented Feb 5, 2022

The current experiment configs are intended as examples and defaults.

  • It should be easy to override these in your own projects without actually modifying the source code code of disent or forking the project

The current disent.registry is largely unused and inflexible.

  • It should be easy for an end-user to write their own experiments, custom code and frameworks without modifying disent itself.
  • A basic plugin system should be enabled that allows this functionality and experiment running.
@nmichlo nmichlo added enhancement New feature or request refactoring Internal changes to the code that do not change the outputs. labels Feb 5, 2022
@nmichlo nmichlo added this to the v0.4.0 milestone Feb 5, 2022
@nmichlo
Copy link
Owner Author

nmichlo commented Feb 5, 2022

Before this can happen. Research code needs to be fully pulled out from dissent into its own separate repo. This can be used as a test base for these features.

@nmichlo
Copy link
Owner Author

nmichlo commented Feb 5, 2022

Features implemented in: 4e2fe38

  • Split out research code

  • Naive plugin functionality with experiment.run, append to the config list experiment.plugins with python import paths to a function that registers values with the library. For example: experiment.plugins="['your_module. register_to_disent']"

  • Override the main experiment search path by specifying the environment variable DISENT_CONFIG_ROOTS=.../path/to/your/configs. This hydra config directory will be added to the hydra search path and take precedence over the configs provided by disent in the experiment/configs directory. You can easily copy, paste and modify files, or even add new ones for when running experiments.

  • Using the naive experiment plugin functionality above, you can register components with disent using the disent registry. For example if you write a new framework, you can add your own configs above, but you can also add an entry in the registry using:

import disent.registry as R
def register_to_disent():
    R.FRAMEWORKS.setm['x__adaave_tvae'] = R.LazyImport('research.code.frameworks.vae._supervised__adaave_tvae.AdaAveTripletVae')

@nmichlo nmichlo closed this as completed Feb 5, 2022
@nmichlo
Copy link
Owner Author

nmichlo commented Feb 5, 2022

Docs need to be updated #7

@nmichlo nmichlo added the documentation Improvements or additions to documentation label Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request refactoring Internal changes to the code that do not change the outputs.
Projects
None yet
Development

No branches or pull requests

1 participant