mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 18:39:55 +08:00
1 parent
7fc970f1c7
commit
1d14263127
10 files changed
+102
-153
No files matched your search
@@ -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)
|
||||
@@ -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` "
|
||||
|
||||
Reference in new issue
Block a user