mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-28 17:29:30 +00:00
Merge pull request #267 from bobtajson/main
fix: correct typo and improve code quality
This commit is contained in:
commit
c96b8a1255
3 changed files with 7 additions and 5 deletions
|
|
@ -721,7 +721,7 @@ class BaseEnv(ABC):
|
||||||
eval_result = {
|
eval_result = {
|
||||||
"config_general": {
|
"config_general": {
|
||||||
"model_name": model_name,
|
"model_name": model_name,
|
||||||
"total_evaluation_time_secondes": str(end_time - start_time),
|
"total_evaluation_time_seconds": str(end_time - start_time),
|
||||||
"generation_parameters": merged_gen_params,
|
"generation_parameters": merged_gen_params,
|
||||||
},
|
},
|
||||||
"results": {
|
"results": {
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ GameHistory = List[GameStep]
|
||||||
class EvaluationConfigGeneral(TypedDict):
|
class EvaluationConfigGeneral(TypedDict):
|
||||||
"""Configuration section of evaluation results."""
|
"""Configuration section of evaluation results."""
|
||||||
|
|
||||||
total_evaluation_time_secondes: str
|
total_evaluation_time_seconds: str
|
||||||
model_name: Optional[str]
|
model_name: Optional[str]
|
||||||
generation_parameters: Dict[str, Any]
|
generation_parameters: Dict[str, Any]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,15 @@ import numpy as np
|
||||||
def get_std_min_max_avg(name: str, data: list, metrics_dict: dict) -> dict:
|
def get_std_min_max_avg(name: str, data: list, metrics_dict: dict) -> dict:
|
||||||
"""
|
"""
|
||||||
Calculate the standard deviation, minimum, maximum, and average of a list of numbers.
|
Calculate the standard deviation, minimum, maximum, and average of a list of numbers.
|
||||||
Adds it to the wandb dict for logging.
|
Adds it to the metrics dict for logging.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
data (list): A list of numbers.
|
name: The base name for the metrics keys.
|
||||||
|
data: A list of numbers to compute statistics from.
|
||||||
|
metrics_dict: Dictionary to add the computed metrics to.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: A dictionary containing the standard deviation, minimum, maximum, and average.
|
The updated metrics dictionary with added statistics (mean, std, max, min).
|
||||||
"""
|
"""
|
||||||
metrics_dict[f"{name}_mean"] = np.mean(data)
|
metrics_dict[f"{name}_mean"] = np.mean(data)
|
||||||
metrics_dict[f"{name}_std"] = np.std(data)
|
metrics_dict[f"{name}_std"] = np.std(data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue