-
Notifications
You must be signed in to change notification settings - Fork 68
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
Utilities for generating monty_config
and dataset_args
for an arbitrary number of LMs.
#94
base: main
Are you sure you want to change the base?
Utilities for generating monty_config
and dataset_args
for an arbitrary number of LMs.
#94
Conversation
Reworked ordering for 'distant' ordery_by, and cleaned up docs.
…/tbp.monty into multi_lm_config_utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks very useful! I left a few comments, mostly around variable and function names.
On a more general note, it would be nice if you can include the usage example from your PR description either in the documentation or in the docstring. In the usage example it would be good to specify the monty_config_args
as a dictionary with keys instead of a list where it matters in which order they are specified and it is a lot less verbose (hence why you probably added comments)
I'm currently scrubbing references to learning modules in my |
Changed `make_mult_lm_monty_config` to take (required) keyword arguments. Also changed it to accept a `connectivity_func` that produces connectivity matrices.
I'm ready for another round of review. Here's a brief summary of changes:
I haven't added a usage example to a docstring yet. I'm undecided as to where that should go (either In general, I'm finding it a bit tricky to find the balance between a more generic approach that can support future use cases and functions that are useful now. For example, some functions (e.g., I expect there will be some more back and forth about further changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice PR, thanks for the super clear documentation. Just added a few comments.
Re. the names of the functions, I agree it's a hard balance to strike - personally I'm ok with how they are now, i.e. avoiding making the names super specific, but then also very long-winded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates! Looks very nice :) Happy to merge after you go through Niels comments.
Added optional `view_finder_config` parameter to `make_multi_lm_monty_config`.
Set `semantics` default to `False` except for the last entry which must be `True` for the view finder.
Update: defaulting to
One of two errors was thrown, depending on the changes I made. Since these problems tie into our planned changes to |
This adds a few functions to
config_args.py
andmake_dataset_configs.py
that allow users to create multi-LM experiment configs without writing and using custom config data classes.Added to
config_args.py
make_multi_lm_monty_config
: The top-level utility function. Builds aMontyConfig
object given some the number of LMs and Monty/SM/LM classes with their associated arguments.make_multi_lm_connectivity
: generatessm_to_agent_dict
,sm_to_lm_matrix
,lm_to_lm_matrix
, andlm_to_lm_vote_matrix
for "typical" multi-LM setups (i.e., 1 agent, 1:1 SM -> LM connectivity, all-to-all voting, and no hierarchy). Used bymake_multi_lm_monty_config
and may be useful if you write yourMontyConfig
generator.Added to
make_dataset_configs.py
make_multi_lm_habitat_dataset_args
: The top-level utility function. Builds aMultiLMMountHabitatDatasetArgs
object given the number of SMs and optionally some mount parameters (such as sensor positions, zooms, etc.).make_multi_lm_mount_config
: Builds a dictionary of mount parameters (positions, resolutions, etc.).make_multi_lm_sensor_positions
: Generates sensor positions. See my comment for more info.Here's a usage example:
I'm currently using a pattern like this in
dmc_pretraining_experiments.py
anddmc_eval_experiments.py
(though I haven't submitted a monty_lab PR yet). It made it easy to add 4, 8, and 16 LM experiments and removed the need for a bunch of hand-made dataclasses (farewell toTenLMMountHabitatDatasetArgs
,EnvInitArgsTenLMMount
, andTenLMMountConfig
).Testing: I re-wrote DMC experiments to use these config generators. I then ran
dist_agent_5lm
anddist_agent_5lm_randrot_noise
, and the results were identical. I've also pretrained models with 2, 4, 5, 8, 9, 10, and 16 LMs, and the object models look good.