diff --git a/README.md b/README.md index bb014c9..057ef0f 100644 --- a/README.md +++ b/README.md @@ -55,18 +55,9 @@ https://www.anaconda.com/ **Windows 사용자** -git bash에서 다음 명령어를 실행시켜 conda 명령어가 동작하도록 합니다. - ```bash -$ echo ". /c/Users/{유저이름}/anaconda3/etc/profile.d/conda.sh" >> ~/.profile -``` - -git bash를 재실행하고 다음 명령어를 차례대로 실행시켜 주세요. - -```bash -$ conda activate meta - -(meta) $ sh ./scripts/window-init.sh +# 사용자 +(meta) $ "./scripts/window-init.bat" ``` ### 4. 모델 학습 및 결과 확인 diff --git a/requirements.txt b/requirements.txt index e0befe3..f674a48 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ autopep8==1.5.0 GPUtil==1.4.0 -gym>=0.24.1 +gym==0.24.1 imageio>=2.1.2 jupyter==1.0.0 jupyter-contrib-nbextensions==0.5.1 jupyter-nbextensions-configurator==0.4.1 matplotlib>=3.5.2 -mujoco>=2.2.0 +mujoco==2.2.0 torchmeta>=1.8.0 tqdm>=4.62.3 diff --git a/scripts/window-init.sh b/scripts/window-init.bat similarity index 94% rename from scripts/window-init.sh rename to scripts/window-init.bat index 4d5e9df..de20ed4 100644 --- a/scripts/window-init.sh +++ b/scripts/window-init.bat @@ -1,5 +1,3 @@ -#!/bin/bash - pip install -e . pip install -r requirements.txt python ./scripts/download-torch.py diff --git a/src/meta_rl/envs/__init__.py b/src/meta_rl/envs/__init__.py index 9b3e00f..df43cd2 100644 --- a/src/meta_rl/envs/__init__.py +++ b/src/meta_rl/envs/__init__.py @@ -1,10 +1,11 @@ import importlib import os +from typing import Callable ENVS = {} -def register_env(name: str) -> function: +def register_env(name: str) -> Callable: def register_env_fn(filename: str) -> str: if name in ENVS: raise ValueError(f"Cannot register duplicate env {name}") diff --git a/src/meta_rl/maml/algorithm/networks.py b/src/meta_rl/maml/algorithm/networks.py index db45d70..100e639 100644 --- a/src/meta_rl/maml/algorithm/networks.py +++ b/src/meta_rl/maml/algorithm/networks.py @@ -63,8 +63,8 @@ def __init__( self.log_std = torch.Tensor([init_std]).log() self.log_std = torch.nn.Parameter(self.log_std) - self.min_log_std = torch.Tensor([min_std]).log().item() if not min_std else None - self.max_log_std = torch.Tensor([max_std]).log().item() if not max_std else None + self.min_log_std = torch.Tensor([min_std]).log().item() if min_std is not None else None + self.max_log_std = torch.Tensor([max_std]).log().item() if max_std is not None else None self.is_deterministic = is_deterministic diff --git a/src/meta_rl/maml/maml_trainer.py b/src/meta_rl/maml/maml_trainer.py index 73ed23e..18ff825 100644 --- a/src/meta_rl/maml/maml_trainer.py +++ b/src/meta_rl/maml/maml_trainer.py @@ -12,13 +12,14 @@ if __name__ == "__main__": # 실험 환경 설정에 대한 하이퍼파라미터들 불러오기 - with open(os.path.join("configs", "experiment_config.yaml"), "r") as file: + with open(os.path.join("configs", "experiment_config.yaml"), "r", encoding="utf-8") as file: experiment_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader) # 목표 보상 설정에 대한 하이퍼파라미터들 불러오기 with open( os.path.join("configs", experiment_config["env_name"] + "_target_config.yaml"), "r", + encoding="utf-8", ) as file: env_target_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader) diff --git a/src/meta_rl/pearl/pearl_trainer.py b/src/meta_rl/pearl/pearl_trainer.py index 124c8e4..c4cadfd 100644 --- a/src/meta_rl/pearl/pearl_trainer.py +++ b/src/meta_rl/pearl/pearl_trainer.py @@ -12,13 +12,14 @@ if __name__ == "__main__": # 실험 환경 설정에 대한 하이퍼파라미터들 불러오기 - with open(os.path.join("configs", "experiment_config.yaml"), "r") as file: + with open(os.path.join("configs", "experiment_config.yaml"), "r", encoding="utf-8") as file: experiment_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader) # 목표 보상 설정에 대한 하이퍼파라미터들 불러오기 with open( os.path.join("configs", experiment_config["env_name"] + "_target_config.yaml"), "r", + encoding="utf-8", ) as file: env_target_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader) diff --git a/src/meta_rl/rl2/rl2_trainer.py b/src/meta_rl/rl2/rl2_trainer.py index 7bd5345..da8940c 100644 --- a/src/meta_rl/rl2/rl2_trainer.py +++ b/src/meta_rl/rl2/rl2_trainer.py @@ -12,13 +12,14 @@ if __name__ == "__main__": # 실험 환경 설정에 대한 하이퍼파라미터들 불러오기 - with open(os.path.join("configs", "experiment_config.yaml"), "r") as file: + with open(os.path.join("configs", "experiment_config.yaml"), "r", encoding="utf-8") as file: experiment_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader) # 목표 보상 설정에 대한 하이퍼파라미터들 불러오기 with open( os.path.join("configs", experiment_config["env_name"] + "_target_config.yaml"), "r", + encoding="utf-8", ) as file: env_target_config: Dict[str, Any] = yaml.load(file, Loader=yaml.FullLoader)