mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 06:14:03 +08:00
Updating metrics dict code and logic for all the graphs (#198)
* illustrating logic of metrics dict with vanilla nerf * updated all graph impls * clean up. * cleanup. * format. Co-authored-by: Alexander Kristoffersen <akristoffersen@berkeley.edu>
This commit is contained in:
1 parent
0777883fb6
commit
934bd4bd72
8 files changed
+43
-23
No files matched your search
@@ -126,3 +126,19 @@ def human_format(num):
|
||||
k = 1000.0
|
||||
magnitude = int(floor(log(num, k)))
|
||||
return f"{(num / k**magnitude):.2f} {units[magnitude]}"
|
||||
|
||||
|
||||
def scale_dict(dictionary: Dict[Any, Any], coefficients: DictConfig) -> Dict[Any, Any]:
|
||||
"""Scale a dictionary in-place given a coefficients dictionary.
|
||||
|
||||
Args:
|
||||
dictionary: input dict to be scaled.
|
||||
coefficients: scalar dict config for holding coefficients.
|
||||
|
||||
Returns:
|
||||
Input dict scaled by coefficients.
|
||||
"""
|
||||
for key in dictionary:
|
||||
if key in coefficients:
|
||||
dictionary[key] *= coefficients[key]
|
||||
return dictionary
|
||||
Reference in new issue
Block a user