Change demo file compatible to python2 (#40)

* Change demo file to python2 compatible

* Add object to classes for compatibility with python2
This commit is contained in:
Whi Kwon
2019-04-07 13:06:39 +09:00
committed by GitHub
parent a130293f8b
commit 16ae4375c9
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ import numpy as np
import torch
class AbstractAgent:
class AbstractAgent(object):
"""Abstract Agent used for all agents.
Attributes:
@@ -11,7 +11,7 @@ from algorithms.common.helper_functions import get_n_step_info
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class ReplayBuffer:
class ReplayBuffer(object):
"""Fixed-size buffer to store experience tuples.
Taken from Udacity deep-reinforcement-learning github repository:
@@ -79,7 +79,7 @@ class ReplayBuffer:
return len(self.buffer)
class NStepTransitionBuffer:
class NStepTransitionBuffer(object):
"""Fixed-size buffer to store experience tuples.
Attributes:
@@ -4,7 +4,7 @@
import operator
class SegmentTree:
class SegmentTree(object):
""" Create SegmentTree.
Taken from OpenAI baselines github repository:
+2 -2
View File
@@ -7,7 +7,7 @@ import random
import numpy as np
class GaussianNoise:
class GaussianNoise(object):
"""Gaussian Noise.
Taken from https://github.com/vitchyr/rlkit
@@ -28,7 +28,7 @@ class GaussianNoise:
return np.random.normal(0, sigma, size=self.action_dim)
class OUNoise:
class OUNoise(object):
"""Ornstein-Uhlenbeck process.
Taken from Udacity deep-reinforcement-learning github repository: