-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] Enable default settings for TrainerSettings #4448
Conversation
# Check if a default_settings was specified. If so, used those as the default | ||
# rather than an empty dict. | ||
if TrainerSettings.default_override is not None: | ||
d_copy.update(cattr.unstructure(TrainerSettings.default_override)) |
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.
I'm not sure if this will do what you want for nested dictionaries. For example if you had
{"foo": {"x": 1}}.update({"foo", {"y": 2}})
you'd end up with {"foo", {"y": 2}}
, but I think you really want {"foo", {"x": 1, "y": 2}}
(i.e. recursively merge dictionary values)
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.
Fixed using a recursive dict update
docs/Training-ML-Agents.md
Outdated
# < Same as above > | ||
``` | ||
|
||
Behaviors found in the environment that aren't secified in the YAML will now use the `default_settings`, |
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.
Behaviors found in the environment that aren't secified in the YAML will now use the `default_settings`, | |
Behaviors found in the environment that aren't specified in the YAML will now use the `default_settings`, |
Proposed change(s)
Based on feedback from CarryCastle. Enables specifying a default TrainerSettings for all behaviors. The default is specified using the same structure as the others under a new header
default_settings
. These are now used as the default values for all behaviors, including those not found in the settings YAML.For behavior names that are defined in the YAML, any missing fields will be filled first from the
default_settings
, then those defined in the TrainerSettings class insettings.py
.WIP: Tests, documentation
Types of change(s)
Checklist