-
Notifications
You must be signed in to change notification settings - Fork 4.3k
add to_string for samplers #4484
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
Conversation
@@ -144,11 +145,16 @@ def update_lessons( | |||
self._smoothed_values[param_name] = new_smoothing | |||
if must_increment: | |||
GlobalTrainingStatus.set_parameter_state( | |||
param_name, StatusType.LESSON_NUM, lesson_num + 1 |
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.
lesson_num + 1
occurred in 2-3 places
""" | ||
Helper method to output sampler stats to console. | ||
""" | ||
return f"Float: value={self.value}" |
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.
Another approach would be to use __repr__
, and make the string sufficient to reconstruct the object:
So in this case it would be something like return f"ConstantSettings(value={self.value})"
Co-authored-by: Chris Elion <[email protected]>
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.
Looks good, can you just add a quick unit test?
Proposed change(s)
This increases the verbosity of the curriculum lesson changes by adding to_strings to the sampler classes. The lesson updates would now output the sampler stats in addition to the lesson and parameter name to the console. See below for sample.
This was done to address a request here #4464
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
Types of change(s)
Checklist
Other comments