eval progress bar with more metrics (#499)

updated eval
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-09-20 20:07:35 -07:00
1 parent 7fc970f1c7
commit 1d14263127
10 files changed
+102 -153

No files matched your search

+16
View File
@@ -163,4 +163,20 @@ def scale_dict(dictionary: Dict[Any, Any], coefficients: Dict[str, float]) -> Di
def step_check(step, step_size, run_at_zero=False) -> bool:
"""Returns true based on current step and step interval."""
if step_size == 0:
return False
return (run_at_zero or step != 0) and step % step_size == 0
def _update_avg(prev_avg: float, new_val: float, step: int) -> float:
"""helper to calculate the running average
Args:
prev_avg (float): previous average value
new_val (float): new value to update the average with
step (int): current step number
Returns:
float: new updated average
"""
return (step * prev_avg + new_val) / (step + 1)
+2 -1
View File
@@ -376,7 +376,8 @@ class LocalWriter:
Args:
step: current train step
"""
if step > 0:
valid_step = step > 0 and step % GLOBAL_BUFFER["steps_per_log"] == 0
if valid_step:
if not self.has_printed and self.config.max_log_size:
logging.info(
"\x1b[33;20mPrinting max of %d lines. Set flag `--logging.local-writer.max-log-size=0` "