diff --git a/hsuanwuhub/datasets/atari_100k.py b/hsuanwuhub/datasets/atari_100k.py new file mode 100644 index 0000000..975d68c --- /dev/null +++ b/hsuanwuhub/datasets/atari_100k.py @@ -0,0 +1,26 @@ +from typing import Dict +from huggingface_hub import hf_hub_download +import pandas as pd +import numpy as np + + +class Atari_100k(object): + def __init__(self) -> None: + file = hf_hub_download( + repo_id="RLE-Foundation/HsuanwuHub", + repo_type="dataset", + filename="atari_100k.json", + subfolder="datasets" + ) + self.atari_100k_data = pd.read_json(file) + + def load_scores(self) -> Dict[str, np.ndarray]: + """Returns final performance""" + scores_dict = dict() + for algo in self.atari_100k_data.keys(): + scores_dict[algo] = np.array([value for _, value in self.atari_100k_data[algo].items()]).T + + return scores_dict + + def load_curves(self) -> np.ndarray: + pass diff --git a/hsuanwuhub/datasets/atari_200_iters.py b/hsuanwuhub/datasets/atari_200_iters.py new file mode 100644 index 0000000..702c8f6 --- /dev/null +++ b/hsuanwuhub/datasets/atari_200_iters.py @@ -0,0 +1,27 @@ +from typing import Dict +from huggingface_hub import hf_hub_download +import numpy as np + + +class Atari_200_iters(object): + def __init__(self) -> None: + file = hf_hub_download( + repo_id="RLE-Foundation/HsuanwuHub", + repo_type="dataset", + filename="atari_200_iters_normalized_scores.npy", + subfolder="datasets" + ) + + with open(file, 'rb') as f: + atari_200m_scores = np.load(f, allow_pickle=True) + atari_200m_scores = atari_200m_scores.tolist() + for key, val in atari_200m_scores.items(): + atari_200m_scores[key] = np.transpose(val, axes=(1, 2, 0)) + self.atari_200_iters_normalized_scores = atari_200m_scores + + def load_scores(self) -> Dict[str, np.ndarray]: + """Returns final performance""" + return self.atari_200_iters_normalized_scores + + def load_curves(self) -> np.ndarray: + pass diff --git a/hsuanwuhub/datasets/dm_control.py b/hsuanwuhub/datasets/dm_control.py new file mode 100644 index 0000000..daec6dc --- /dev/null +++ b/hsuanwuhub/datasets/dm_control.py @@ -0,0 +1,26 @@ +from typing import Dict +from huggingface_hub import hf_hub_download +import pandas as pd +import numpy as np + + +class DM_Control(object): + def __init__(self) -> None: + file = hf_hub_download( + repo_id="RLE-Foundation/HsuanwuHub", + repo_type="dataset", + filename="dm_control.json", + subfolder="datasets" + ) + self.dm_control_data = pd.read_json(file) + + def load_scores(self) -> Dict[str, np.ndarray]: + """Returns final performance""" + scores_dict = dict() + for algo in self.dm_control_data.keys(): + scores_dict[algo] = np.array([value for _, value in self.dm_control_data[algo].items()]).T + + return scores_dict + + def load_curves(self) -> np.ndarray: + pass