From 354472a7b85b3477079e10250a1b167cdbd538f0 Mon Sep 17 00:00:00 2001 From: malin10 Date: Thu, 9 Jul 2020 23:36:27 +0800 Subject: [PATCH] bug fix --- models/rank/linear_regression/config.yaml | 6 +++--- models/rank/linear_regression/data/test_data/data | 0 models/rank/linear_regression/data/test_data/data.txt | 10 ++++++++++ models/rank/linear_regression/data/train_data/data | 0 models/rank/linear_regression/data/train_data/data.txt | 10 ++++++++++ models/rank/linear_regression/model.py | 2 ++ 6 files changed, 25 insertions(+), 3 deletions(-) delete mode 100644 models/rank/linear_regression/data/test_data/data create mode 100644 models/rank/linear_regression/data/test_data/data.txt delete mode 100644 models/rank/linear_regression/data/train_data/data create mode 100644 models/rank/linear_regression/data/train_data/data.txt diff --git a/models/rank/linear_regression/config.yaml b/models/rank/linear_regression/config.yaml index 29e81409..db29a8ed 100644 --- a/models/rank/linear_regression/config.yaml +++ b/models/rank/linear_regression/config.yaml @@ -14,7 +14,7 @@ # global settings debug: false -workspace: "/home/aistudio/PaddleRec-master/models/rank/linear_regression" +workspace: "paddlerec.models.rank.linear_regression" dataset: @@ -53,7 +53,7 @@ runner: save_inference_interval: 1 save_checkpoint_path: "increment" save_inference_path: "inference" - print_interval: 100 + print_interval: 1 - name: infer_runner class: infer device: cpu @@ -68,5 +68,5 @@ phase: thread_num: 12 #- name: infer_phase # model: "{workspace}/model.py" -# dataset_name: infer_sample +# dataset_name: dataset_infer # thread_num: 1 diff --git a/models/rank/linear_regression/data/test_data/data b/models/rank/linear_regression/data/test_data/data deleted file mode 100644 index e69de29b..00000000 diff --git a/models/rank/linear_regression/data/test_data/data.txt b/models/rank/linear_regression/data/test_data/data.txt new file mode 100644 index 00000000..2c1f9878 --- /dev/null +++ b/models/rank/linear_regression/data/test_data/data.txt @@ -0,0 +1,10 @@ +logid:406201811 time:959974725 userid:782959 gender:713968 age:367871 occupation:887870 movieid:593474 title:389382 title:420426 title:697263 title:759044 genres:220363 label:2 +logid:731667808 time:957756905 userid:317013 gender:715500 age:959669 occupation:956770 movieid:436098 title:195371 genres:43405 genres:22907 label:5 +logid:914109775 time:956936565 userid:466839 gender:713968 age:655161 occupation:113614 movieid:495392 title:304668 title:924099 title:819199 genres:893545 genres:750128 label:4 +logid:130407756 time:956926305 userid:845353 gender:713968 age:367871 occupation:113678 movieid:278462 title:631279 title:75815 title:683892 genres:697846 genres:893545 genres:803235 label:4 +logid:162344002 time:956945570 userid:467391 gender:713968 age:930457 occupation:113614 movieid:757292 title:437909 title:67566 title:663931 title:622433 title:973752 genres:455809 label:2 +logid:172473319 time:956934181 userid:263429 gender:713968 age:655161 occupation:113862 movieid:889490 title:186300 title:677155 title:937049 title:622433 title:855502 genres:220363 label:2 +logid:814895539 time:956890758 userid:734503 gender:715500 age:930457 occupation:113614 movieid:312477 title:594818 title:491338 title:234546 genres:220363 genres:532872 label:3 +logid:721088277 time:973289822 userid:278745 gender:713968 age:367871 occupation:300174 movieid:673898 title:774924 title:61321 title:755193 genres:891961 genres:455809 label:5 +logid:487566723 time:956907971 userid:192959 gender:713968 age:367871 occupation:113614 movieid:722671 title:677184 title:108182 title:974616 title:797604 genres:697846 genres:893545 genres:220363 genres:803235 label:5 +logid:960590831 time:978252470 userid:297629 gender:715500 age:292885 occupation:113738 movieid:301175 title:508793 title:829566 title:199430 title:158723 title:467516 genres:43405 label:3 diff --git a/models/rank/linear_regression/data/train_data/data b/models/rank/linear_regression/data/train_data/data deleted file mode 100644 index e69de29b..00000000 diff --git a/models/rank/linear_regression/data/train_data/data.txt b/models/rank/linear_regression/data/train_data/data.txt new file mode 100644 index 00000000..cee804d8 --- /dev/null +++ b/models/rank/linear_regression/data/train_data/data.txt @@ -0,0 +1,10 @@ +logid:966771740 time:962590666 userid:170728 gender:713968 age:367871 occupation:645306 movieid:790755 title:824881 title:127016 genres:697846 genres:893545 genres:803235 label:4 +logid:353175809 time:968974066 userid:414067 gender:713968 age:292885 occupation:113738 movieid:729061 title:372631 title:838478 title:144774 title:593993 genres:220363 genres:853044 label:5 +logid:376358153 time:973455150 userid:867983 gender:713968 age:655161 occupation:113862 movieid:546406 title:697513 title:9603 title:37653 genres:220363 label:5 +logid:532644334 time:959798907 userid:854849 gender:713968 age:367871 occupation:113738 movieid:310450 title:748457 title:214082 genres:220363 label:3 +logid:499989270 time:967918013 userid:852221 gender:713968 age:655161 occupation:113614 movieid:427238 title:665231 title:622433 title:225707 genres:43405 label:4 +logid:580343064 time:966375464 userid:886104 gender:713968 age:367871 occupation:113738 movieid:715507 title:668677 title:234546 genres:697846 genres:220363 genres:803235 genres:455809 label:3 +logid:866282024 time:974636987 userid:606130 gender:713968 age:263859 occupation:991290 movieid:818748 title:28827 title:590550 title:622433 title:973752 genres:43405 genres:22907 label:4 +logid:56511742 time:975233847 userid:535824 gender:713968 age:367871 occupation:113614 movieid:468606 title:491533 title:887940 title:622433 title:549750 genres:43405 genres:532872 genres:22907 label:5 +logid:909168601 time:965277736 userid:157 gender:713968 age:688501 occupation:113862 movieid:753872 title:26739 title:622433 title:797604 genres:697846 genres:532872 genres:455809 label:3 +logid:641667514 time:960083820 userid:875780 gender:715500 age:367871 occupation:113882 movieid:956826 title:191999 title:108182 title:496485 title:549750 genres:220363 genres:532872 label:4 diff --git a/models/rank/linear_regression/model.py b/models/rank/linear_regression/model.py index 1680092a..8ee32e17 100644 --- a/models/rank/linear_regression/model.py +++ b/models/rank/linear_regression/model.py @@ -55,6 +55,8 @@ class Model(ModelBase): sparse_embed_seq = list(map(embedding_layer, sparse_var)) weight = fluid.layers.concat(sparse_embed_seq, axis=0) + if is_infer: + fluid.layers.Print(weight) weight_sum = fluid.layers.reduce_sum(weight) b_linear = fluid.layers.create_parameter( shape=[1], -- GitLab