From 81d3e073cd387558e29f2d76fb1e1db3b07ced39 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 26 Jun 2020 01:48:42 -0700 Subject: [PATCH] reducing unnecessary files --- .gitignore | 1 + conda_env.yml | 104 ++++++++++++++++++++++++++++-------------------- environment.yml | 10 ----- test.py | 87 ---------------------------------------- 4 files changed, 62 insertions(+), 140 deletions(-) delete mode 100644 environment.yml delete mode 100644 test.py diff --git a/.gitignore b/.gitignore index 532bb8d..b99d288 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,4 @@ dmypy.json # Results results/ MUJOCO_LOG.TXT +test.py diff --git a/conda_env.yml b/conda_env.yml index 7be4077..1d3701e 100644 --- a/conda_env.yml +++ b/conda_env.yml @@ -1,68 +1,86 @@ -name: planet -channels: +name: dreamer +channe: + - pytorch - defaults + - conda-forge dependencies: - _libgcc_mutex=0.1=main - - _pytorch_select=0.1=cpu_0 + - astroid=2.4.2=py38_0 - blas=1.0=mkl - ca-certificates=2020.1.1=0 - - certifi=2019.11.28=py37_1 - - cffi=1.14.0=py37h2e261b9_0 - - cudatoolkit=10.1.243=h6bb024c_0 - - cudnn=7.6.5=cuda10.1_0 - - freetype=2.9.1=h8a8886c_1 - - intel-openmp=2020.0=166 - - jpeg=9b=h024ee3a_2 + - certifi=2020.4.5.2=py38_0 + - cudatoolkit=10.2.89=hfd86e86_1 + - intel-openmp=2020.1=217 + - isort=4.3.21=py38_0 + - lazy-object-proxy=1.4.3=py38h7b6447c_0 - ld_impl_linux-64=2.33.1=h53a641e_7 - libedit=3.1.20181209=hc058e9b_0 - - libffi=3.2.1=hd88cf55_4 + - libffi=3.3=he6710b0_1 - libgcc-ng=9.1.0=hdf63c60_0 - libgfortran-ng=7.3.0=hdf63c60_0 - - libpng=1.6.37=hbc83047_0 - libstdcxx-ng=9.1.0=hdf63c60_0 - - libtiff=4.1.0=h2733197_0 - - mkl=2020.0=166 - - mkl-service=2.3.0=py37he904b0f_0 - - mkl_fft=1.0.15=py37ha843d7b_0 - - mkl_random=1.1.0=py37hd6b4f25_0 - - ncurses=6.2=he6710b0_0 - - ninja=1.9.0=py37hfd86e86_0 - - numpy=1.18.1=py37h4f9e942_0 - - numpy-base=1.18.1=py37hde5b4d6_1 - - olefile=0.46=py37_0 - - openssl=1.1.1f=h7b6447c_0 - - pip=20.0.2=py37_1 - - plotly=4.5.2=py_0 - - pycparser=2.20=py_0 - - python=3.7.7=hcf32534_0_cpython - - pytorch=1.3.1=cpu_py37h62f834f_0 + - mccabe=0.6.1=py38_1 + - mkl=2020.1=217 + - mkl-service=2.3.0=py38he904b0f_0 + - mkl_fft=1.0.15=py38ha843d7b_0 + - mkl_random=1.1.1=py38h0573a6f_0 + - ncurses=6.2=he6710b0_1 + - ninja=1.9.0=py38hfd86e86_0 + - numpy=1.18.1=py38h4f9e942_0 + - numpy-base=1.18.1=py38hde5b4d6_1 + - openssl=1.1.1g=h7b6447c_0 + - pip=20.0.2=py38_3 + - plotly=4.8.1=py_0 + - pylint=2.5.3=py38_0 + - python=3.8.3=hcff3b4d_0 + - pytorch=1.5.0=py3.8_cuda10.2.89_cudnn7.6.5_0 - readline=8.0=h7b6447c_0 - retrying=1.3.3=py_2 - - setuptools=46.1.3=py37_0 - - six=1.14.0=py37_0 - - sqlite=3.31.1=h7b6447c_0 + - setuptools=47.1.1=py38_0 + - six=1.15.0=py_0 + - sqlite=3.31.1=h62c20be_1 - tk=8.6.8=hbc83047_0 - - torchvision=0.4.2=cpu_py37h9ec355b_0 - - tqdm=4.44.1=py_0 - - wheel=0.34.2=py37_0 - - xz=5.2.4=h14c3975_4 + - toml=0.10.0=py_0 + - tqdm=4.46.0=py_0 + - wheel=0.34.2=py38_0 + - wrapt=1.11.2=py38h7b6447c_0 + - xz=5.2.5=h7b6447c_0 - zlib=1.2.11=h7b6447c_3 - - zstd=1.3.7=h0b5b093_0 - pip: - absl-py==0.9.0 + - cachetools==4.1.0 + - chardet==3.0.4 - cloudpickle==1.3.0 - dm-control==0.0.300771433 - dm-env==1.2 - - dm-tree==0.1.4 + - dm-tree==0.1.5 - future==0.18.2 - - glfw==1.11.0 - - gym==0.17.1 - - lxml==4.5.0 - - opencv-python==4.2.0.32 - - pillow==6.1.0 + - glfw==1.11.2 + - google-auth==1.18.0 + - google-auth-oauthlib==0.4.1 + - grpcio==1.29.0 + - gym==0.17.2 + - idna==2.9 + - lxml==4.5.1 + - markdown==3.2.2 + - oauthlib==3.1.0 + - opencv-python==4.2.0.34 + - pillow==7.1.2 + - protobuf==3.12.2 + - pyasn1==0.4.8 + - pyasn1-modules==0.2.8 - pyglet==1.5.0 - pyopengl==3.1.5 - - pyparsing==2.4.6 + - pyparsing==2.4.7 + - requests==2.24.0 + - requests-oauthlib==1.3.0 + - rsa==4.6 - scipy==1.4.1 + - tb-nightly==2.3.0a20200620 + - tensorboard-plugin-wit==1.6.0.post3 + - tensorboardx==2.0 + - torchvision==0.6.0 + - urllib3==1.25.9 + - werkzeug==1.0.1 prefix: /home/demo/miniconda3/envs/planet diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 2191f90..0000000 --- a/environment.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: planet -channels: - - pytorch -dependencies: - - plotly - - pytorch - - tqdm - - pip: - - gym - - opencv-python diff --git a/test.py b/test.py deleted file mode 100644 index 9b962f0..0000000 --- a/test.py +++ /dev/null @@ -1,87 +0,0 @@ -from utils import lambda_return, FreezeParameters -import torch -from torch.distributions.normal import Normal -from torch.distributions.transformed_distribution import TransformedDistribution -from torch.distributions.transforms import Transform, TanhTransform -from torch.nn import functional as F - -transition_model = torch.nn.Linear(20, 10) -value_model = torch.nn.Linear(10, 2) - -# with FreezeParameters([value_model]): -inp1 = torch.ones(20) -returns = torch.zeros(2) -inp2 = transition_model(inp1) -with torch.no_grad(): - inp2 = inp2.detach() -value_pred = value_model(inp2) -target_return = returns.detach() -transition_loss = F.mse_loss(value_pred, target_return).mean(dim=(0)) - -# with FreezeParameters([transition_model]): -# inp1 = torch.ones(20) -# returns = torch.zeros(2) -# inp2 = transition_model(inp1) -# value_pred = value_model(inp2) -# target_return = returns.detach() -# value_loss = F.mse_loss(value_pred, target_return).mean(dim=(0)) - -transition_loss.backward() -print(transition_model.weight.grad) -print(value_model.weight.grad) -# value_loss.backward() -# print(transition_model.weight.grad) -# print(value_model.weight.grad) - - -# disclam = 0.95 -# discount = 0.99 -# reward = torch.arange(0,30).view(3,2,5) -# flatten = lambda x: x.view([-1]+list(x.size()[2:])) -# value = torch.arange(30,60).view(3,10) - -# print(flatten(reward)) - -# returns = lambda_return( -# reward[:-1], value[:-1], bootstrap=value[-1], lambda_=disclam) - -# print(returns) -# print(returns.size()) - -# PYTORCH -# [57.9398, 60.8608, 63.7819, 66.7030, 69.6241, 72.5452, 75.4663, 78.3874, 81.3085, 84.2296] -# [59.5000, 61.4900, 63.4800, 65.4700, 67.4600, 69.4500, 71.4400, 73.4300, 75.4200, 77.4100] - -# TF -# [57.93975 60.860844 63.781944 66.70304 69.62414 72.54523 75.466324, 78.38741 81.30851 84.22961 ] -# [59.5 , 61.489998 63.480003 65.47 67.46001 69.45 71.44 73.43 75.42 77.41 ]] - -# mean = torch.zeros((3,4)) -# std = torch.ones((3,4)) -# dist = Normal(mean, std) -# dist = TransformedDistribution(dist, TanhTransform()) -# # sample = dist.sample_n(2) -# # print("sample: ", sample) # torch.Size([100, 1, 6]) - - -# sample = torch.Tensor([[[ 0.5467947, -0.1615259, 0.85917974, 0.8844119 ], -# [ 0.9430844, -0.65128314, -0.37722188, -0.7573055 ], -# [ 0.97344655, 0.23397793, -0.5207381, -0.8949507 ]], - -# [[-0.02690708, 0.93916935, -0.7454547, 0.54994726], -# [-0.8515325, -0.87329435, 0.5729679, -0.7884654 ], -# [-0.4692143, -0.7107713, -0.4622952, 0.73246235]]]) - -# print(sample) - -# logprob = dist.log_prob(sample) -# print("logprob: ",logprob) -# logprob = logprob.sum(2) -# print("logprob: ",logprob.size()) -# print("logprob: ",logprob) -# # still not sure how the following parts work -# logprob_argmax = torch.argmax(logprob,0) -# # print("logprob argmax:", logprob_argmax) # torch.Size([1, 6]) -# sample = sample[logprob_argmax] -# # print("sample selected: ",sample) #torch.Size([1, 6, 1, 6]) --> have to be [1, 6] -# print("return:", sample[0]) \ No newline at end of file