Skip to content

Commit

Permalink
hotfix/setup_for_window (#98)
Browse files Browse the repository at this point in the history
* hotfix/setup_for_window

* .
  • Loading branch information
Clyde21c committed Jul 21, 2022
1 parent 5f70050 commit 402e777
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 모델 학습 및 결과 확인
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions scripts/window-init.sh → scripts/window-init.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

pip install -e .
pip install -r requirements.txt
python ./scripts/download-torch.py
Expand Down
3 changes: 2 additions & 1 deletion src/meta_rl/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -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}")
Expand Down
4 changes: 2 additions & 2 deletions src/meta_rl/maml/algorithm/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/meta_rl/maml/maml_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion src/meta_rl/pearl/pearl_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion src/meta_rl/rl2/rl2_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 402e777

Please sign in to comment.