Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
dcac042e
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dcac042e
编写于
8月 21, 2019
作者:
W
wangyihong01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feasign bugfix
Change-Id: If9ac80c5a3781034caaed328045b056034fee6c9
上级
edad1a7f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
19 deletion
+19
-19
paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc
...le/fluid/train/custom_trainer/feed/dataset/data_reader.cc
+18
-18
paddle/fluid/train/custom_trainer/feed/dataset/dataset_container.cc
...id/train/custom_trainer/feed/dataset/dataset_container.cc
+0
-0
paddle/fluid/train/custom_trainer/feed/process/learner_process.cc
...luid/train/custom_trainer/feed/process/learner_process.cc
+1
-1
未找到文件。
paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc
浏览文件 @
dcac042e
...
@@ -87,7 +87,7 @@ public:
...
@@ -87,7 +87,7 @@ public:
std
::
string
tags
;
std
::
string
tags
;
std
::
map
<
std
::
string
,
std
::
vector
<
float
>>
vec_feas
;
std
::
map
<
std
::
string
,
std
::
vector
<
float
>>
vec_feas
;
int
sample_type
;
int
sample_type
;
std
::
map
<
std
::
string
,
std
::
vector
<
int
>>
auc_category_info_map
;
//为细维度计算auc准备的数据
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
auc_category_info_map
;
//为细维度计算auc准备的数据
std
::
vector
<
FeatureItem
>
hot_feas
,
cold_feas
;
//冷(int32_t)热(uint64_t)feasign
std
::
vector
<
FeatureItem
>
hot_feas
,
cold_feas
;
//冷(int32_t)热(uint64_t)feasign
void
clear
()
{
void
clear
()
{
...
@@ -149,7 +149,7 @@ public:
...
@@ -149,7 +149,7 @@ public:
return
cursor
;
return
cursor
;
}
}
void
parse
_feas
(
char
*
buffer
)
const
{
void
serialize_to_compress
_feas
(
char
*
buffer
)
const
{
if
(
buffer
==
nullptr
)
{
if
(
buffer
==
nullptr
)
{
return
;
return
;
}
}
...
@@ -293,16 +293,21 @@ public:
...
@@ -293,16 +293,21 @@ public:
std
::
string
&
single_category_str
=
all_category_vec
[
i
];
std
::
string
&
single_category_str
=
all_category_vec
[
i
];
std
::
vector
<
std
::
string
>
str_vec
=
paddle
::
string
::
split_string
(
single_category_str
,
"="
);
std
::
vector
<
std
::
string
>
str_vec
=
paddle
::
string
::
split_string
(
single_category_str
,
"="
);
CHECK
(
str_vec
.
size
()
==
2
);
CHECK
(
str_vec
.
size
()
==
2
);
/*
std::string category_name = str_vec[0];
std
::
string
category_name
=
str_vec
[
0
];
std::vector<
int> category_info_vec = paddle::string::split_string<int
>(str_vec[1], ",");
std
::
vector
<
std
::
string
>
category_info_vec
=
paddle
::
string
::
split_string
<
std
::
string
>
(
str_vec
[
1
],
","
);
CHECK
(
category_info_vec
.
size
()
>
0
);
CHECK
(
category_info_vec
.
size
()
>
0
);
CHECK(rec.auc_category_info_map.insert({category_name, category_info_vec}).second);
*/
CHECK
(
rec
.
auc_category_info_map
.
insert
({
category_name
,
category_info_vec
}).
second
);
}
}
}
else
{
}
else
{
uint64_t
sign
=
0
;
uint64_t
sign
=
0
;
int
slot
=
-
1
;
int
slot
=
-
1
;
CHECK
((
sign
=
(
uint64_t
)
strtoull
(
str
,
&
cursor
,
10
),
cursor
!=
str
));
sign
=
(
uint64_t
)
strtoull
(
str
,
&
cursor
,
10
);
if
(
cursor
==
str
)
{
//FIXME abacus没有这种情况
str
++
;
continue
;
}
//CHECK((sign = (uint64_t)strtoull(str, &cursor, 10), cursor != str));
str
=
cursor
;
str
=
cursor
;
CHECK
(
*
str
++
==
':'
);
CHECK
(
*
str
++
==
':'
);
CHECK
(
!
isspace
(
*
str
));
CHECK
(
!
isspace
(
*
str
));
...
@@ -320,17 +325,12 @@ public:
...
@@ -320,17 +325,12 @@ public:
}
}
paddle
::
framework
::
BinaryArchive
bar
;
paddle
::
framework
::
BinaryArchive
bar
;
bar
<<
rec
.
show
;
bar
<<
rec
.
show
<<
rec
.
clk
<<
rec
.
tags
<<
rec
.
vec_feas
<<
rec
.
sample_type
<<
rec
.
auc_category_info_map
;
bar
<<
rec
.
clk
;
uint32_t
feas_len
=
rec
.
calc_compress_feas_lens
();
//事先计算好压缩后feasign的空间
bar
<<
rec
.
tags
;
bar
<<
rec
.
vec_feas
;
bar
<<
rec
.
sample_type
;
bar
<<
rec
.
auc_category_info_map
;
uint32_t
feas_len
=
rec
.
calc_compress_feas_lens
();
bar
<<
feas_len
;
bar
<<
feas_len
;
bar
.
Resize
(
bar
.
Length
()
+
feas_len
);
bar
.
Resize
(
bar
.
Length
()
+
feas_len
);
rec
.
parse_feas
(
bar
.
Cursor
());
rec
.
serialize_to_compress_feas
(
bar
.
Finish
()
-
feas_len
);
//直接在archive内部buffer进行压缩,避免不必要的拷贝
data
.
data
.
assign
(
bar
.
Buffer
(),
bar
.
Length
());
data
.
data
.
assign
(
bar
.
Buffer
(),
bar
.
Length
());
//TODO 这一步拷贝是否也能避免
return
0
;
return
0
;
}
}
...
@@ -355,7 +355,6 @@ public:
...
@@ -355,7 +355,6 @@ public:
paddle
::
framework
::
BinaryArchive
bar
;
paddle
::
framework
::
BinaryArchive
bar
;
bar
.
SetReadBuffer
(
const_cast
<
char
*>
(
&
data
.
data
[
0
]),
data
.
data
.
size
(),
nullptr
);
bar
.
SetReadBuffer
(
const_cast
<
char
*>
(
&
data
.
data
[
0
]),
data
.
data
.
size
(),
nullptr
);
bar
>>
show
;
bar
>>
show
;
bar
>>
clk
;
bar
>>
clk
;
bar
>>
tags
;
bar
>>
tags
;
...
@@ -363,13 +362,14 @@ public:
...
@@ -363,13 +362,14 @@ public:
bar
>>
sample_type
;
bar
>>
sample_type
;
bar
>>
auc_category_info_map
;
bar
>>
auc_category_info_map
;
bar
>>
feas_len
;
bar
>>
feas_len
;
parse_feas_to_ins
(
bar
.
Cursor
(),
feas_len
,
instance
.
features
);
CHECK
((
bar
.
Finish
()
-
bar
.
Cursor
())
==
feas_len
);
deserialize_feas_to_ins
(
bar
.
Cursor
(),
feas_len
,
instance
.
features
);
return
0
;
return
0
;
}
}
private:
private:
void
pars
e_feas_to_ins
(
char
*
buffer
,
uint32_t
len
,
std
::
vector
<
FeatureItem
>&
ins
)
const
{
void
deserializ
e_feas_to_ins
(
char
*
buffer
,
uint32_t
len
,
std
::
vector
<
FeatureItem
>&
ins
)
const
{
if
(
buffer
==
nullptr
)
{
if
(
buffer
==
nullptr
)
{
return
;
return
;
}
}
...
...
paddle/fluid/train/custom_trainer/feed/dataset/dataset_container.cc
100644 → 100755
浏览文件 @
dcac042e
文件模式从 100644 更改为 100755
paddle/fluid/train/custom_trainer/feed/process/learner_process.cc
100644 → 100755
浏览文件 @
dcac042e
...
@@ -76,7 +76,7 @@ int LearnerProcess::run() {
...
@@ -76,7 +76,7 @@ int LearnerProcess::run() {
uint64_t
epoch_id
=
epoch_accessor
->
current_epoch_id
();
uint64_t
epoch_id
=
epoch_accessor
->
current_epoch_id
();
environment
->
log
(
EnvironmentRole
::
WORKER
,
EnvironmentLogType
::
MASTER_LOG
,
EnvironmentLogLevel
::
NOTICE
,
environment
->
log
(
EnvironmentRole
::
WORKER
,
EnvironmentLogType
::
MASTER_LOG
,
EnvironmentLogLevel
::
NOTICE
,
"Resume train
e
with epoch_id:%d label:%s"
,
epoch_id
,
_context_ptr
->
epoch_accessor
->
text
(
epoch_id
).
c_str
());
"Resume train with epoch_id:%d label:%s"
,
epoch_id
,
_context_ptr
->
epoch_accessor
->
text
(
epoch_id
).
c_str
());
//判断是否先dump出base
//判断是否先dump出base
wait_save_model
(
epoch_id
,
ModelSaveWay
::
ModelSaveInferenceBase
);
wait_save_model
(
epoch_id
,
ModelSaveWay
::
ModelSaveInferenceBase
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录