-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a callback to log raw stats (#216)
* Add a callback to log raw stats * Fixes and use tensorboard output directly * Add test case and changelog * fix CI * Update test Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
- Loading branch information
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import subprocess | ||
|
||
|
||
def _assert_eq(left, right): | ||
assert left == right, f"{left} != {right}" | ||
|
||
|
||
def test_raw_stat_callback(tmp_path): | ||
args = [ | ||
"-n", | ||
str(200), | ||
"--algo", | ||
"ppo", | ||
"--env", | ||
"CartPole-v1", | ||
"-params", | ||
"callback:'utils.callbacks.RawStatisticsCallback'", | ||
"--tensorboard-log", | ||
f"{tmp_path}", | ||
] | ||
|
||
return_code = subprocess.call(["python", "train.py"] + args) | ||
_assert_eq(return_code, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters