mirror of
https://github.com/vale981/ray
synced 2025-03-04 17:41:43 -05:00
[RLlib] Tolerate nan metrics in LearnerInfoBuilder. (#27981)
This commit is contained in:
parent
5fb36d4a7d
commit
56e7800e0b
1 changed files with 2 additions and 0 deletions
|
@ -106,5 +106,7 @@ def _all_tower_reduce(path, *tower_data):
|
|||
# Max stats: Reduce max.
|
||||
elif path[-1].startswith("max_"):
|
||||
return np.nanmax(tower_data)
|
||||
if np.isnan(tower_data).all():
|
||||
return np.nan
|
||||
# Everything else: Reduce mean.
|
||||
return np.nanmean(tower_data)
|
||||
|
|
Loading…
Add table
Reference in a new issue