Skip to content

Commit 16ae437

Browse files
authored
Change demo file compatible to python2 (#40)
* Change demo file to python2 compatible * Add object to classes for compatibility with python2
1 parent a130293 commit 16ae437

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

scripts/algorithms/common/abstract/agent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import torch
1515

1616

17-
class AbstractAgent:
17+
class AbstractAgent(object):
1818
"""Abstract Agent used for all agents.
1919
2020
Attributes:

scripts/algorithms/common/buffer/replay_buffer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
1212

1313

14-
class ReplayBuffer:
14+
class ReplayBuffer(object):
1515
"""Fixed-size buffer to store experience tuples.
1616
1717
Taken from Udacity deep-reinforcement-learning github repository:
@@ -79,7 +79,7 @@ def __len__(self):
7979
return len(self.buffer)
8080

8181

82-
class NStepTransitionBuffer:
82+
class NStepTransitionBuffer(object):
8383
"""Fixed-size buffer to store experience tuples.
8484
8585
Attributes:

scripts/algorithms/common/buffer/segment_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import operator
55

66

7-
class SegmentTree:
7+
class SegmentTree(object):
88
""" Create SegmentTree.
99
1010
Taken from OpenAI baselines github repository:

scripts/algorithms/common/noise.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88

99

10-
class GaussianNoise:
10+
class GaussianNoise(object):
1111
"""Gaussian Noise.
1212
1313
Taken from https://github.com/vitchyr/rlkit
@@ -28,7 +28,7 @@ def sample(self, t=0):
2828
return np.random.normal(0, sigma, size=self.action_dim)
2929

3030

31-
class OUNoise:
31+
class OUNoise(object):
3232
"""Ornstein-Uhlenbeck process.
3333
3434
Taken from Udacity deep-reinforcement-learning github repository:
384 KB
Binary file not shown.

scripts/data/reacher_demo.pkl

535 KB
Binary file not shown.

0 commit comments

Comments
 (0)