Merge pull request #267 from bobtajson/main

fix: correct typo and improve code quality
This commit is contained in:
dmahan93 2025-11-06 18:36:37 -08:00 committed by GitHub
commit c96b8a1255
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -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": {

View file

@ -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]

View file

@ -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)