Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_strategy_cvr
Commits
6885e903
Commit
6885e903
authored
Jul 30, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update function name
parent
17b5c5c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
tractate_fe.py
src/models/esmm/fe/tractate_fe.py
+1
-1
train_tractate.py
src/train_tractate.py
+4
-4
No files found.
src/models/esmm/fe/tractate_fe.py
View file @
6885e903
...
@@ -30,7 +30,7 @@ def read_csv_data(dataset_path):
...
@@ -30,7 +30,7 @@ def read_csv_data(dataset_path):
return
tractate_df
,
click_df
,
conversion_df
return
tractate_df
,
click_df
,
conversion_df
def
get_tractate_from_redis
():
def
get_tractate_
dict_
from_redis
():
"""
"""
return: {tractate_id: {first_demands: [], is_pure_author: 1}}
return: {tractate_id: {first_demands: [], is_pure_author: 1}}
"""
"""
...
...
src/train_tractate.py
View file @
6885e903
...
@@ -65,18 +65,18 @@ def main():
...
@@ -65,18 +65,18 @@ def main():
predict_fn
=
tf
.
contrib
.
predictor
.
from_saved_model
(
save_path
)
predict_fn
=
tf
.
contrib
.
predictor
.
from_saved_model
(
save_path
)
device_dict
=
device_fe
.
get_device_dict_from_redis
()
device_dict
=
device_fe
.
get_device_dict_from_redis
()
diary
_dict
=
tractate_fe
.
get_tractate_dict_from_redis
()
tractate
_dict
=
tractate_fe
.
get_tractate_dict_from_redis
()
device_ids
=
list
(
device_dict
.
keys
())[:
20
]
device_ids
=
list
(
device_dict
.
keys
())[:
20
]
diary_ids
=
list
(
diary
_dict
.
keys
())
tractate_ids
=
list
(
tractate
_dict
.
keys
())
print
(
device_dict
(
device_ids
[
0
]),
"
\n
"
)
print
(
device_dict
(
device_ids
[
0
]),
"
\n
"
)
print
(
diary_dict
(
diary
_ids
[
0
]),
"
\n
"
)
print
(
tractate_dict
(
tractate
_ids
[
0
]),
"
\n
"
)
for
i
in
range
(
5
):
for
i
in
range
(
5
):
time_1
=
timeit
.
default_timer
()
time_1
=
timeit
.
default_timer
()
res
=
model_predict_tractate
(
res
=
model_predict_tractate
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
200
),
device_dict
,
diary
_dict
,
predict_fn
)
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
tractate_ids
,
200
),
device_dict
,
tractate
_dict
,
predict_fn
)
print
(
res
[:
10
])
print
(
res
[:
10
])
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
),
"
\n
"
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
),
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment