Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
ef8fc7f9
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,发现更多精彩内容 >>
提交
ef8fc7f9
编写于
3月 08, 2019
作者:
K
kechxu
提交者:
Kecheng Xu
3月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: add cruise torch go model
上级
3de38725
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
42 addition
and
23 deletion
+42
-23
modules/prediction/common/prediction_gflags.cc
modules/prediction/common/prediction_gflags.cc
+4
-1
modules/prediction/common/prediction_gflags.h
modules/prediction/common/prediction_gflags.h
+1
-0
modules/prediction/data/cruise_go_vehicle_model.pt
modules/prediction/data/cruise_go_vehicle_model.pt
+0
-0
modules/prediction/evaluator/vehicle/cruise_mlp_evaluator.cc
modules/prediction/evaluator/vehicle/cruise_mlp_evaluator.cc
+37
-22
未找到文件。
modules/prediction/common/prediction_gflags.cc
浏览文件 @
ef8fc7f9
...
...
@@ -138,9 +138,12 @@ DEFINE_string(evaluator_cruise_vehicle_cutin_model_file,
DEFINE_string
(
torch_vehicle_junction_mlp_file
,
"/apollo/modules/prediction/data/junction_mlp_vehicle_model.pt"
,
"Vehicle junction MLP model file"
);
DEFINE_string
(
torch_vehicle_cruise_go_file
,
"/apollo/modules/prediction/data/cruise_go_vehicle_model.pt"
,
"Vehicle cruise cutin model file"
);
DEFINE_string
(
torch_vehicle_cruise_cutin_file
,
"/apollo/modules/prediction/data/cruise_cutin_vehicle_model.pt"
,
"Vehicle cruise
cutin
model file"
);
"Vehicle cruise
go
model file"
);
DEFINE_string
(
evaluator_vehicle_junction_mlp_file
,
"/apollo/modules/prediction/data/junction_mlp_vehicle_model.bin"
,
"Vehicle junction MLP model file"
);
...
...
modules/prediction/common/prediction_gflags.h
浏览文件 @
ef8fc7f9
...
...
@@ -85,6 +85,7 @@ DECLARE_double(pedestrian_max_acc);
DECLARE_double
(
still_speed
);
DECLARE_string
(
evaluator_vehicle_mlp_file
);
DECLARE_string
(
torch_vehicle_junction_mlp_file
);
DECLARE_string
(
torch_vehicle_cruise_go_file
);
DECLARE_string
(
torch_vehicle_cruise_cutin_file
);
DECLARE_string
(
evaluator_cruise_vehicle_go_model_file
);
DECLARE_string
(
evaluator_cruise_vehicle_cutin_model_file
);
...
...
modules/prediction/data/cruise_go_vehicle_model.pt
浏览文件 @
ef8fc7f9
无法预览此类型文件
modules/prediction/evaluator/vehicle/cruise_mlp_evaluator.cc
浏览文件 @
ef8fc7f9
...
...
@@ -108,14 +108,25 @@ void CruiseMLPEvaluator::Evaluate(Obstacle* obstacle_ptr) {
torch_input
[
0
][
i
]
=
static_cast
<
float
>
(
feature_values
[
i
]);
}
torch_inputs
.
push_back
(
torch_input
.
to
(
device_
));
auto
torch_output_tuple
=
torch_cutin_model_ptr_
->
forward
(
torch_inputs
).
toTuple
();
auto
probability_tensor
=
torch_output_tuple
->
elements
()[
0
].
toTensor
();
auto
finish_time_tensor
=
torch_output_tuple
->
elements
()[
1
].
toTensor
();
lane_sequence_ptr
->
set_probability
(
Sigmoid
(
static_cast
<
double
>
(
probability_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
])));
lane_sequence_ptr
->
set_time_to_lane_center
(
static_cast
<
double
>
(
finish_time_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
]));
if
(
lane_sequence_ptr
->
vehicle_on_lane
())
{
auto
torch_output_tuple
=
torch_go_model_ptr_
->
forward
(
torch_inputs
).
toTuple
();
auto
probability_tensor
=
torch_output_tuple
->
elements
()[
0
].
toTensor
();
auto
finish_time_tensor
=
torch_output_tuple
->
elements
()[
1
].
toTensor
();
lane_sequence_ptr
->
set_probability
(
Sigmoid
(
static_cast
<
double
>
(
probability_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
])));
lane_sequence_ptr
->
set_time_to_lane_center
(
static_cast
<
double
>
(
finish_time_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
]));
}
else
{
auto
torch_output_tuple
=
torch_cutin_model_ptr_
->
forward
(
torch_inputs
).
toTuple
();
auto
probability_tensor
=
torch_output_tuple
->
elements
()[
0
].
toTensor
();
auto
finish_time_tensor
=
torch_output_tuple
->
elements
()[
1
].
toTensor
();
lane_sequence_ptr
->
set_probability
(
Sigmoid
(
static_cast
<
double
>
(
probability_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
])));
lane_sequence_ptr
->
set_time_to_lane_center
(
static_cast
<
double
>
(
finish_time_tensor
.
accessor
<
float
,
2
>
()[
0
][
0
]));
}
}
}
...
...
@@ -140,20 +151,22 @@ void CruiseMLPEvaluator::ExtractFeatureValues(
feature_values
->
insert
(
feature_values
->
end
(),
obstacle_feature_values
.
begin
(),
obstacle_feature_values
.
end
());
// Extract interaction features.
// std::vector<double> interaction_feature_values;
// SetInteractionFeatureValues(obstacle_ptr, lane_sequence_ptr,
// &interaction_feature_values);
// if (interaction_feature_values.size() != INTERACTION_FEATURE_SIZE) {
// ADEBUG << "Obstacle [" << id << "] has fewer than "
// << "expected lane feature_values"
// << interaction_feature_values.size() << ".";
// return;
// }
// ADEBUG << "Interaction feature size = " << interaction_feature_values.size();
// feature_values->insert(feature_values->end(),
// interaction_feature_values.begin(),
// interaction_feature_values.end());
/*
Extract interaction features.
std::vector<double> interaction_feature_values;
SetInteractionFeatureValues(obstacle_ptr, lane_sequence_ptr,
&interaction_feature_values);
if (interaction_feature_values.size() != INTERACTION_FEATURE_SIZE) {
ADEBUG << "Obstacle [" << id << "] has fewer than "
<< "expected lane feature_values"
<< interaction_feature_values.size() << ".";
return;
}
ADEBUG << "Interaction feature size = " << interaction_feature_values.size();
feature_values->insert(feature_values->end(),
interaction_feature_values.begin(),
interaction_feature_values.end());
*/
// Extract lane related features.
std
::
vector
<
double
>
lane_feature_values
;
...
...
@@ -534,6 +547,8 @@ void CruiseMLPEvaluator::LoadModels() {
// ADEBUG << "CUDA is available";
// device_ = torch::Device(torch::kCUDA);
// }
torch_go_model_ptr_
=
torch
::
jit
::
load
(
FLAGS_torch_vehicle_cruise_go_file
,
device_
);
torch_cutin_model_ptr_
=
torch
::
jit
::
load
(
FLAGS_torch_vehicle_cruise_cutin_file
,
device_
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录