[rllib] throw an error for continuous action spaces in IMPALA

We currently don't support this since the reference vtrace.py does not, though it could be an interesting extension.
This commit is contained in:
Eric Liang
2018-09-03 11:12:55 -07:00
committed by GitHub
parent df4788e501
commit 01b030bd57
2 changed files with 2 additions and 4 deletions
@@ -107,10 +107,7 @@ class VTracePolicyGraph(LearningRateSchedule, TFPolicyGraph):
tf.get_variable_scope().name)
# Setup the policy loss
if isinstance(action_space, gym.spaces.Box):
ac_size = action_space.shape[0]
actions = tf.placeholder(tf.float32, [None, ac_size], name="ac")
elif isinstance(action_space, gym.spaces.Discrete):
if isinstance(action_space, gym.spaces.Discrete):
ac_size = action_space.n
actions = tf.placeholder(tf.int64, [None], name="ac")
else:
@@ -94,6 +94,7 @@ class ModelSupportedSpaces(unittest.TestCase):
def testAll(self):
ray.init()
stats = {}
check_support("IMPALA", {"gpu": False}, stats)
check_support("DDPG", {"timesteps_per_iteration": 1}, stats)
check_support("DQN", {"timesteps_per_iteration": 1}, stats)
check_support("A3C", {