Skip to content

Commit

Permalink
Enhance/update meta-sl (#77)
Browse files Browse the repository at this point in the history
* ..

* ..

* ..

* ..

* ..

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .
  • Loading branch information
dongminlee94 committed Jun 19, 2022
1 parent 5f3ba5b commit 20ebcd5
Show file tree
Hide file tree
Showing 16 changed files with 2,297 additions and 2,322 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ venv.bak/
# tensorboard
runs/

# results
# Repository
runs/
results/
dataset/
saved_model/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ init:
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
python3 -m ipykernel install --user
bash ./hooks/install.sh

init-dev:
make init
pip install -r requirements-dev.txt
bash ./hooks/install.sh
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,22 @@ Meta-SL은 각 알고리즘 폴더로 이동하여 `jupyter notebook`을 이용
$ jupyter notebook
```

Colab을 이용하실 경우, 아래의 명령어를 cell에 입력하여 PyTorch 관련 패키지들을 설치하고 이용해주세요.

```python
!pip install torchmeta torchtext==0.10.1 torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
```

Meta-RL은 각 알고리즘 폴더로 이동하여 아래의 명령어들을 이용하여 실행해주세요.

```bash
# RL^2
$ rl2_trainer.py

# or

# MAML
$ maml_trainer.py

# or

# PEARL
$ pearl_trainer.py
```

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ requires = [
]
build-backend = "setuptools.build_meta"

[requires]
python_version = "3.8"

[tool.black]
line-length = 104
target-version = ["py38"]
target-version = ["py37", "py38"]
exclude = ""

[tool.isort]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gym>=0.24.1
jupyter==1.0.0
jupyter-contrib-nbextensions==0.5.1
jupyter-nbextensions-configurator==0.4.1
matplotlib>=3.5.2
mujoco>=2.2.0
torchmeta>=1.8.0
tqdm>=4.62.3
6 changes: 3 additions & 3 deletions scripts/download-torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
def main() -> None:
if sys.platform == "win32" or sys.platform == "linux":
if GPUtil.getAvailable():
cli = "pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html"
cli = "pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html"
else:
cli = "pip install torch==1.8.1+cpu torchvision==0.9.1+cpu -f https://download.pytorch.org/whl/torch_stable.html"
cli = "pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html"
elif sys.platform == "darwin":
cli = "pip install torch==1.8.1 torchvision==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html"
cli = "pip install torch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html"
print(cli)
os.system(cli)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_version(*file_path_parts):
version="latest",
packages=find_packages("src"),
package_dir={"": "src"},
python_requires=">=3.8",
python_requires=">=3.7",
author="Dongmin Lee, Seunghyun Lee",
author_email="[email protected], [email protected]",
description="'모두를 위한 메타러닝' 책에 대한 코드 저장소",
Expand Down
2 changes: 1 addition & 1 deletion src/meta_rl/envs/half_cheetah.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
https://github.com/katerakelly/oyster/blob/master/rlkit/envs/half_cheetah.py
"""

from typing import List, Optional, Union
from typing import List, Union

import numpy as np
from gym import utils
Expand Down
Loading

0 comments on commit 20ebcd5

Please sign in to comment.