Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[carla] [rllib] Add support for carla nav planner and scenarios from paper #1382

Merged
merged 111 commits into from
Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
e889b6e
wip
ericl Dec 30, 2017
e93b29c
Sat Dec 30 15:07:28 PST 2017
ericl Dec 30, 2017
bb3889b
log video
ericl Dec 30, 2017
5c5eea8
video doesn't work well
ericl Dec 30, 2017
8cc67f7
scenario integration
ericl Dec 31, 2017
ae0c344
Sat Dec 30 17:30:22 PST 2017
ericl Dec 31, 2017
d00ddd4
Sat Dec 30 17:31:05 PST 2017
ericl Dec 31, 2017
21209f3
Sat Dec 30 17:31:32 PST 2017
ericl Dec 31, 2017
b03d0ec
Sat Dec 30 17:32:16 PST 2017
ericl Dec 31, 2017
0f9260f
Sat Dec 30 17:34:11 PST 2017
ericl Dec 31, 2017
487aa7e
Sat Dec 30 17:34:50 PST 2017
ericl Dec 31, 2017
f958f10
Sat Dec 30 17:35:34 PST 2017
ericl Dec 31, 2017
24ef0ba
Sat Dec 30 17:38:49 PST 2017
ericl Dec 31, 2017
5de22a0
Sat Dec 30 17:40:39 PST 2017
ericl Dec 31, 2017
3dec63e
Sat Dec 30 17:43:00 PST 2017
ericl Dec 31, 2017
0ea276b
Sat Dec 30 17:43:04 PST 2017
ericl Dec 31, 2017
d9ae096
Sat Dec 30 17:45:56 PST 2017
ericl Dec 31, 2017
03899e6
Sat Dec 30 17:46:26 PST 2017
ericl Dec 31, 2017
354662c
Sat Dec 30 17:47:02 PST 2017
ericl Dec 31, 2017
22e2d58
Sat Dec 30 17:51:53 PST 2017
ericl Dec 31, 2017
2bf227f
Sat Dec 30 17:52:54 PST 2017
ericl Dec 31, 2017
fb94331
Sat Dec 30 17:56:43 PST 2017
ericl Dec 31, 2017
d304bc4
Sat Dec 30 18:27:07 PST 2017
ericl Dec 31, 2017
d445cab
Sat Dec 30 18:27:52 PST 2017
ericl Dec 31, 2017
a523809
fix train
ericl Dec 31, 2017
2856251
Sat Dec 30 18:41:51 PST 2017
ericl Dec 31, 2017
f831be7
Sat Dec 30 18:54:11 PST 2017
ericl Dec 31, 2017
4defc5b
Sat Dec 30 18:56:22 PST 2017
ericl Dec 31, 2017
5335b8b
Sat Dec 30 19:05:04 PST 2017
ericl Dec 31, 2017
0ae9642
Sat Dec 30 19:05:23 PST 2017
ericl Dec 31, 2017
471e2e3
Sat Dec 30 19:11:53 PST 2017
ericl Dec 31, 2017
7d74f7b
Sat Dec 30 19:14:31 PST 2017
ericl Dec 31, 2017
8715559
Sat Dec 30 19:16:20 PST 2017
ericl Dec 31, 2017
3ff4769
Sat Dec 30 19:18:05 PST 2017
ericl Dec 31, 2017
2707699
Sat Dec 30 19:18:45 PST 2017
ericl Dec 31, 2017
787eff2
Sat Dec 30 19:22:44 PST 2017
ericl Dec 31, 2017
01a1b74
Sat Dec 30 19:24:41 PST 2017
ericl Dec 31, 2017
d173818
Sat Dec 30 19:26:57 PST 2017
ericl Dec 31, 2017
484e3c7
Sat Dec 30 19:40:37 PST 2017
ericl Dec 31, 2017
f2e43c4
wip models
ericl Jan 1, 2018
053d201
reward bonus
ericl Jan 1, 2018
64234c4
test prep
ericl Jan 1, 2018
c5c9607
Sun Dec 31 18:45:25 PST 2017
ericl Jan 1, 2018
9ef49b9
Sun Dec 31 18:58:28 PST 2017
ericl Jan 1, 2018
8cf0294
Sun Dec 31 18:59:34 PST 2017
ericl Jan 1, 2018
51fc48c
Sun Dec 31 19:03:33 PST 2017
ericl Jan 1, 2018
9385e01
Sun Dec 31 19:05:05 PST 2017
ericl Jan 1, 2018
391e6ba
Sun Dec 31 19:09:25 PST 2017
ericl Jan 1, 2018
f9969c1
fix train
ericl Jan 1, 2018
6c18557
kill
ericl Jan 1, 2018
43fa3a8
add tuple preprocessor
ericl Jan 1, 2018
1d81108
Sun Dec 31 20:38:33 PST 2017
ericl Jan 1, 2018
009855e
Sun Dec 31 22:51:24 PST 2017
ericl Jan 1, 2018
f97e532
Sun Dec 31 23:14:13 PST 2017
ericl Jan 1, 2018
0a8d3a8
Sun Dec 31 23:16:04 PST 2017
ericl Jan 1, 2018
4598130
Mon Jan 1 00:08:35 PST 2018
ericl Jan 1, 2018
36bb961
Mon Jan 1 00:10:48 PST 2018
ericl Jan 1, 2018
56eb3ff
Mon Jan 1 01:08:31 PST 2018
ericl Jan 1, 2018
f780c03
Mon Jan 1 14:45:44 PST 2018
ericl Jan 1, 2018
473cdb7
Mon Jan 1 14:54:56 PST 2018
ericl Jan 1, 2018
8bfe4e1
Mon Jan 1 17:29:29 PST 2018
ericl Jan 2, 2018
1accf8a
switch to euclidean dists
ericl Jan 2, 2018
508d97e
Mon Jan 1 17:39:27 PST 2018
ericl Jan 2, 2018
2d10c29
Mon Jan 1 17:41:47 PST 2018
ericl Jan 2, 2018
b79baa0
Mon Jan 1 17:44:18 PST 2018
ericl Jan 2, 2018
c7808f1
Mon Jan 1 17:47:09 PST 2018
ericl Jan 2, 2018
ed71b3c
Mon Jan 1 20:31:02 PST 2018
ericl Jan 2, 2018
1e3eb84
Merge remote-tracking branch 'upstream/master' into carla-full
ericl Jan 2, 2018
d983dbd
Mon Jan 1 20:39:33 PST 2018
ericl Jan 2, 2018
0c3029d
Mon Jan 1 20:40:55 PST 2018
ericl Jan 2, 2018
ecdab8a
Mon Jan 1 20:55:06 PST 2018
ericl Jan 2, 2018
83b612c
Mon Jan 1 21:05:52 PST 2018
ericl Jan 2, 2018
7e3f899
fix env path
ericl Jan 2, 2018
454e125
merge richards fix
ericl Jan 2, 2018
558f257
fix hash
ericl Jan 2, 2018
57ac904
Merge branch 'fix-hasher' into carla-full
ericl Jan 2, 2018
415a405
Mon Jan 1 22:04:00 PST 2018
ericl Jan 2, 2018
f380c8f
Mon Jan 1 22:25:29 PST 2018
ericl Jan 2, 2018
6aebc09
Mon Jan 1 22:30:42 PST 2018
ericl Jan 2, 2018
8688f08
simplified reward function
ericl Jan 3, 2018
2e08cf4
add framestack
ericl Jan 3, 2018
756a45a
add env configs
ericl Jan 3, 2018
03e250d
simplify speed reward
ericl Jan 3, 2018
de6a1fe
Tue Jan 2 17:36:15 PST 2018
ericl Jan 3, 2018
56cddf0
Tue Jan 2 17:49:16 PST 2018
ericl Jan 3, 2018
42d4249
Tue Jan 2 18:10:38 PST 2018
ericl Jan 3, 2018
1cd7173
add lane keeping simple mode
ericl Jan 3, 2018
7d5f70a
Tue Jan 2 20:25:26 PST 2018
ericl Jan 3, 2018
562f458
Tue Jan 2 20:30:30 PST 2018
ericl Jan 3, 2018
b7b1591
Tue Jan 2 20:33:26 PST 2018
ericl Jan 3, 2018
febec65
Tue Jan 2 20:41:42 PST 2018
ericl Jan 3, 2018
1366073
ppo lane keep
ericl Jan 3, 2018
85354fa
simplify discrete actions
ericl Jan 3, 2018
f8cdbce
Tue Jan 2 21:41:05 PST 2018
ericl Jan 3, 2018
6491857
Tue Jan 2 21:49:03 PST 2018
ericl Jan 3, 2018
b26307a
Tue Jan 2 22:12:23 PST 2018
ericl Jan 3, 2018
a2dcad7
Tue Jan 2 22:14:42 PST 2018
ericl Jan 3, 2018
9230bd1
Tue Jan 2 22:20:59 PST 2018
ericl Jan 3, 2018
eb63ded
Tue Jan 2 22:23:43 PST 2018
ericl Jan 3, 2018
1917467
Tue Jan 2 22:26:27 PST 2018
ericl Jan 3, 2018
3d72c48
Tue Jan 2 22:27:20 PST 2018
ericl Jan 3, 2018
680976c
Tue Jan 2 22:44:00 PST 2018
ericl Jan 3, 2018
815c722
Tue Jan 2 22:57:58 PST 2018
ericl Jan 3, 2018
f63b478
Tue Jan 2 23:08:51 PST 2018
ericl Jan 3, 2018
5585165
Tue Jan 2 23:11:32 PST 2018
ericl Jan 3, 2018
dab3cf7
update dqn reward
ericl Jan 4, 2018
4bdf399
Thu Jan 4 12:29:40 PST 2018
ericl Jan 4, 2018
0f81717
Thu Jan 4 12:30:26 PST 2018
ericl Jan 4, 2018
41d82f5
Merge remote-tracking branch 'upstream/master' into carla-full
ericl Jan 5, 2018
604935e
Update train_dqn.py
ericl Jan 6, 2018
5d11bac
fix
pcmoritz Jan 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test prep
  • Loading branch information
ericl committed Jan 1, 2018
commit 64234c4f92f6b143749c083ba81bbe4b7b562e56
6 changes: 3 additions & 3 deletions python/ray/rllib/models/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def _init(self):
print("Custom tuple preprocessor shape is", self.shape)

def transform(self, observation):
return tuple(
[o.transform(p) for (o, p)
in zip(observation, self.preprocessors)])
return np.concatenate([
p.transform(o)
for (o, p) in zip(observation, self.preprocessors)])

return CustomTuplePreprocessor
29 changes: 20 additions & 9 deletions python/ray/rllib/test/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import numpy as np
import tensorflow as tf
import unittest
from gym.spaces import Box, Discrete, Tuple

import ray
from ray.tune.registry import get_registry

from ray.rllib.models import ModelCatalog
from ray.rllib.models.model import Model
from ray.rllib.models.preprocessors import (
NoPreprocessor, OneHotPreprocessor, Preprocessor)
NoPreprocessor, OneHotPreprocessor, Preprocessor, make_tuple_preprocessor)
from ray.rllib.models.fcnet import FullyConnectedNetwork
from ray.rllib.models.visionnet import VisionNetwork

Expand All @@ -34,11 +35,21 @@ def tearDown(self):
def testGymPreprocessors(self):
p1 = ModelCatalog.get_preprocessor(
get_registry(), gym.make("CartPole-v0"))
assert type(p1) == NoPreprocessor
self.assertEqual(type(p1), NoPreprocessor)

p2 = ModelCatalog.get_preprocessor(
get_registry(), gym.make("FrozenLake-v0"))
assert type(p2) == OneHotPreprocessor
self.assertEqual(type(p2), OneHotPreprocessor)

def testTuplePreprocessor(self):
cls = make_tuple_preprocessor(
[Discrete(5), Box(0, 1, shape=(3,))],
[OneHotPreprocessor, NoPreprocessor])
preprocessor = cls(Tuple([Discrete(5), Box(0, 1, shape=(3,))]), {})
self.assertEqual(preprocessor.shape, (8,))
self.assertEqual(
list(preprocessor.transform((0, [1, 2, 3]))),
[float(x) for x in [1, 0, 0, 0, 0, 1, 2, 3]])

def testCustomPreprocessor(self):
ray.init()
Expand All @@ -47,32 +58,32 @@ def testCustomPreprocessor(self):
env = gym.make("CartPole-v0")
p1 = ModelCatalog.get_preprocessor(
get_registry(), env, {"custom_preprocessor": "foo"})
assert type(p1) == CustomPreprocessor
self.assertEqual(str(type(p1)), str(CustomPreprocessor))
p2 = ModelCatalog.get_preprocessor(
get_registry(), env, {"custom_preprocessor": "bar"})
assert type(p2) == CustomPreprocessor2
self.assertEqual(str(type(p2)), str(CustomPreprocessor2))
p3 = ModelCatalog.get_preprocessor(get_registry(), env)
assert type(p3) == NoPreprocessor
self.assertEqual(type(p3), NoPreprocessor)

def testDefaultModels(self):
ray.init()

with tf.variable_scope("test1"):
p1 = ModelCatalog.get_model(
get_registry(), np.zeros((10, 3), dtype=np.float32), 5)
assert type(p1) == FullyConnectedNetwork
self.assertEqual(type(p1), FullyConnectedNetwork)

with tf.variable_scope("test2"):
p2 = ModelCatalog.get_model(
get_registry(), np.zeros((10, 80, 80, 3), dtype=np.float32), 5)
assert type(p2) == VisionNetwork
self.assertEqual(type(p2), VisionNetwork)

def testCustomModel(self):
ray.init()
ModelCatalog.register_custom_model("foo", CustomModel)
p1 = ModelCatalog.get_model(
get_registry(), 1, 5, {"custom_model": "foo"})
assert type(p1) == CustomModel
self.assertEqual(str(type(p1)), str(CustomModel))


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions python/ray/tune/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def flush_values_to_object_store(self):
obj = ray.put(_to_pinnable(v))
self._all_objects[k] = obj
self._refs.append(ray.get(obj))
assert len(self._refs) == len(self._all_objects)


_default_registry = _Registry()