Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0258bd43
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0258bd43
编写于
11月 01, 2018
作者:
P
panjiacheng
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: cruise training feature refactoring.
上级
453bad76
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
5 deletion
+16
-5
modules/prediction/proto/lane_graph.proto
modules/prediction/proto/lane_graph.proto
+2
-1
modules/tools/prediction/mlp_train/common/trajectory.py
modules/tools/prediction/mlp_train/common/trajectory.py
+13
-3
modules/tools/prediction/mlp_train/cruiseMLP_train.py
modules/tools/prediction/mlp_train/cruiseMLP_train.py
+1
-1
未找到文件。
modules/prediction/proto/lane_graph.proto
浏览文件 @
0258bd43
...
...
@@ -44,7 +44,7 @@ message NearbyObstacle {
optional
double
l
=
3
;
// relative to focus obstacle
}
// next id =
19
// next id =
20
message
LaneSequence
{
optional
int32
lane_sequence_id
=
1
;
repeated
LaneSegment
lane_segment
=
2
;
...
...
@@ -62,6 +62,7 @@ message LaneSequence {
optional
double
probability
=
6
[
default
=
0.0
];
optional
double
acceleration
=
7
[
default
=
0.0
];
optional
double
time_to_lane_center
=
16
;
optional
double
time_to_lane_edge
=
19
;
repeated
apollo.common.PathPoint
path_point
=
8
;
enum
BehaviorType
{
...
...
modules/tools/prediction/mlp_train/common/trajectory.py
浏览文件 @
0258bd43
...
...
@@ -203,6 +203,7 @@ class TrajectoryToSample(object):
new_lane_id
=
None
has_started_lane_change
=
False
has_finished_lane_change
=
False
lane_change_start_time
=
None
lane_change_finish_time
=
10.0
# Go through all the subsequent features in this sequence
...
...
@@ -222,12 +223,14 @@ class TrajectoryToSample(object):
# If step into another lane, label lane change to be started.
lane_id_j
=
trajectory
[
j
].
lane
.
lane_feature
.
lane_id
if
lane_id_j
not
in
curr_lane_seq
:
has_started_lane_change
=
True
lane_change_finish_time
=
10.0
if
new_lane_id
is
None
:
if
has_started_lane_change
=
False
:
has_started_lane_change
=
True
lane_change_start_time
=
time_span
lane_change_finish_time
=
10.0
new_lane_id
=
lane_id_j
else
:
has_started_lane_change
=
False
new_lane_id
=
None
# If roughly get to the center of another lane, label lane change to be finished.
left_bound
=
trajectory
[
j
].
lane
.
lane_feature
.
dist_to_left_boundary
...
...
@@ -267,20 +270,24 @@ class TrajectoryToSample(object):
# Obstacle is following the original lane but is never at lane-center:
if
lane_change_finish_time
==
10.0
:
lane_sequence
.
label
=
4
lane_sequence
.
time_to_lane_edge
=
10.0
lane_sequence
.
time_to_lane_center
=
10.0
# Obstacle is following the original lane and moved to lane-center
else
:
lane_sequence
.
label
=
1
lane_sequence
.
time_to_lane_edge
=
10.0
lane_sequence
.
time_to_lane_center
=
lane_change_finish_time
# Obs has stepped out of this lane within 6sec.
else
:
lane_sequence
.
label
=
0
lane_sequence
.
time_to_lane_edge
=
lane_change_start_time
lane_sequence
.
time_to_lane_center
=
100.0
# The current lane is NOT obstacle's original lane.
else
:
# Obstacle is following the original lane.
if
not
has_started_lane_change
:
lane_sequence
.
label
=
-
1
lane_sequence
.
time_to_lane_edge
=
100.0
lane_sequence
.
time_to_lane_center
=
100.0
else
:
new_lane_id_is_in_this_lane_seq
=
False
...
...
@@ -293,15 +300,18 @@ class TrajectoryToSample(object):
# Obstacle has finished lane changing within 6 sec.
if
has_finished_lane_change
:
lane_sequence
.
label
=
2
lane_sequence
.
time_to_lane_edge
=
lane_change_start_time
lane_sequence
.
time_to_lane_center
=
lane_change_finish_time
# Obstacle started lane changing but haven't finished yet.
else
:
lane_sequence
.
label
=
3
lane_sequence
.
time_to_lane_edge
=
lane_change_start_time
lane_sequence
.
time_to_lane_center
=
10.0
# Obstacle has changed to some other lane.
else
:
lane_sequence
.
label
=
-
1
lane_sequence
.
time_to_lane_edge
=
100.0
lane_sequence
.
time_to_lane_center
=
100.0
return
trajectory
...
...
modules/tools/prediction/mlp_train/cruiseMLP_train.py
浏览文件 @
0258bd43
...
...
@@ -181,7 +181,7 @@ Custom defined loss function that lumps the loss of classification and
of regression together.
'''
def
loss_fn
(
c_pred
,
r_pred
,
target
):
loss_C
=
nn
.
BCEWithLogitsLoss
(
pos_weight
=
torch
.
FloatTensor
([
39
.0
]).
cuda
())
#nn.BCELoss()
loss_C
=
nn
.
BCEWithLogitsLoss
(
pos_weight
=
torch
.
FloatTensor
([
1
.0
]).
cuda
())
#nn.BCELoss()
loss_R
=
nn
.
MSELoss
()
loss
=
loss_C
(
c_pred
,
target
[:,
0
].
view
(
target
.
shape
[
0
],
1
))
#loss = 4 * loss_C(c_pred, target[:,0].view(target.shape[0],1)) + \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录