-
Notifications
You must be signed in to change notification settings - Fork 4.3k
collecting latest step as a stat #5264
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
mahon94 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
@@ -209,6 +209,7 @@ def _increment_step(self, n_steps: int, name_behavior_id: str) -> None: | |||
p = self.get_policy(name_behavior_id) | |||
if p: | |||
p.increment_step(n_steps) | |||
self.stats_reporter.set_stat("Step", float(self.get_step)) |
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.
@ervteng Is there a place that I can collect more granular/frequent step updates?
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 think this is the right place if we care about synchronizing with the other metrics.
The other place would be in the AgentProcessor, but that is a bit decoupled from the other metrics as it would be added pre-trajectory assembly.
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.
At some point (e.g. if the inference and training are separate processes) it might be useful to emit both as different stats (e.g. steps_executed
and steps_processed
)
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.
Minor comments on typing but otherwise LGTM
Co-authored-by: Ervin T. <[email protected]>
Co-authored-by: Ervin T. <[email protected]>
…evelop-report-step-in-trainer
@@ -31,6 +31,7 @@ def get_default_stats_writers(run_options: RunOptions) -> List[StatsWriter]: | |||
TensorboardWriter( | |||
checkpoint_settings.write_path, | |||
clear_past_data=not checkpoint_settings.resume, | |||
hidden_keys=["Is Training", "Step"], |
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.
Not a fan of the magic strings here. I think these would be better as a static frozenset() in TensorBoardWriter.
Any thoughts?
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 encouraged @mahon94 to remove it as a magic string from the TensorboardWriter. My thinking is that the writer has no responsibility for the implementation of the trainer or its stats and as such configuration/behavior should be removed from the details of said implementation. The get_default_stats_writers in stats_writer.py plugin on the otherhand is more closely related to the main entry-point/execution of the trainer. et
If it wasn't mutable, I'd say this should just be the default value of TensorboardWriter param and call it a day. Transforming it from a list to a frozenset resolves the mutability issue -- even if it's still a collection of magic strings in the writer. Do you have opinions on the coupling implications?
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 don't have a strong opinion. I am okay leaving it as is.
-format imports and comments
* collecting latest step as a stat * adding a list of hidden_keys to TB summarywriter to hide unnecessary stats from user * fixing precommit * fixing precommit * formating * defined the property types * moving custom defaults to get_default_stats_writers * new test for TensorboardWriter.hidden_keys * improved testing * explicit None evaluation Co-authored-by: Ervin T. <[email protected]> * make hidden_keys optional Co-authored-by: Ervin T. <[email protected]> * adding optional argument * lowering the training threshold to 0.8 on test_var_len_obs_and_goal_poca * Update pytest.yml * Do not merge! droping pytest 3.9 job * -add back pytest -format imports and comments * back to default threshold for test_var_len_obs_and_goal_poca Co-authored-by: mahon94 <[email protected]> Co-authored-by: Ervin T. <[email protected]>
* collecting latest step as a stat * adding a list of hidden_keys to TB summarywriter to hide unnecessary stats from user * fixing precommit * formating * defined the property types * moving custom defaults to get_default_stats_writers * new test for TensorboardWriter.hidden_keys * improved testing * explicit None evaluation Co-authored-by: Ervin T. <[email protected]> * make hidden_keys optional Co-authored-by: Ervin T. <[email protected]> * adding optional argument * lowering the training threshold to 0.8 on test_var_len_obs_and_goal_poca * Update pytest.yml * Do not merge! droping pytest 3.9 job * -add back pytest -format imports and comments * back to default threshold for test_var_len_obs_and_goal_poca Co-authored-by: mahon94 <[email protected]> Co-authored-by: Ervin T. <[email protected]> Co-authored-by: mahon94 <[email protected]> Co-authored-by: Ervin T. <[email protected]>
Proposed change(s)
TensorboardWriter
to hide irrelevant stats based on their keyUseful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
Types of change(s)
Checklist
Other comments