2019-08-23工作进展

  1. 考虑的问题:
    (1) 假如query就只有一个品类关键词,那么使用关键词替换这种方式就是不合理的,这种情况应该怎么办?想到的方式是这种情况就直接使用随机采样或者之前基于类目的方式进行负样本采样,但是这就会带来训练集难易分布不均衡的问题。就像在深度估计中,不能将近景和远景的数据放在一个训练集中。当我们需要远景深度的检测网络的时候,即使有近景的网络也是不能直接使用的,而是需要finetune操作。我认为在推荐算法场景中也不可以将这一点混淆,因为现阶段的神经网络都过于简单,而且数据的丰富度也不够,不可能训练出一个如此完善的神经网络。因此,还是需要将两种难度的网络分开才行
    (2) 验证集不合理的问题:之前mvdssm网络的验证集结果应该也是不合适的,需要重新收集验证集。最好的方式是按照训练集的生成过程来采集,可不可以按照query_id来划分呢?

  2. 构造数据集

306 307 308 309 310 311 313 314

create table graph_embedding.hs_tmp_306 as
select graph_embedding:hs_split_1(item_id, pair, "|") as (item_id, word, weight) from
(select bi_udf:bi_split_value(item_id, tag_result, "%") as (item_id, pair) from
(select item_id, search_kg:alinlp_termweight_ecom(title, "%", "{word}|{weight}", 1, 0) as tag_result from graph_embedding.hs_tmp_303 where lengthb(title) > 0)a)b where lengthb(b.pair) > 0;

create table graph_embedding.hs_tmp_307 as
select graph_embedding:hs_split_1(index, pair, "|") as (index, word, weight) from
(select bi_udf:bi_split_value(index, tag_result, "%") as (index, pair) from
(select index, search_kg:alinlp_termweight_ecom(query, "%", "{word}|{weight}", 1, 0) as tag_result from graph_embedding.hs_tmp_304 where lengthb(query) > 0)a)b where lengthb(b.pair) > 0;

create table graph_embedding.hs_dssm_dic_query_8 as
select graph_embedding:hs_split_1(query_id, pair, "|") as (query_id, word, weight) from
(select bi_udf:bi_split_value(query_id, tag_result, "%") as (query_id, pair) from
(select query_id, search_kg:alinlp_termweight_ecom(query, "%", "{word}|{weight}", 1, 0) as tag_result from graph_embedding.hs_dssm_dic_query_7 where lengthb(query) > 0)a)b where lengthb(b.pair) > 0;


create table hs_tmp_308 as select item_id as id, word, search_kg:alinlp_word_embedding(hs_return_clean(word), "100", "CONTENT_SEARCH") as emb from hs_tmp_306;

create table hs_tmp_309 as select index as id, word, search_kg:alinlp_word_embedding(hs_return_clean(word), "100", "CONTENT_SEARCH") as emb from hs_tmp_307;

create table hs_dssm_dic_query_9 as select query_id as id, word, search_kg:alinlp_word_embedding(hs_return_clean(word), "100", "CONTENT_SEARCH") as emb from hs_dssm_dic_query_8;

create table hs_tmp_310 as
select b.id, a.word, b.emb, a.weight, graph_embedding:change_weight_query_key_1(a.word, a.weight) as new_weight from hs_tmp_306 a join hs_tmp_308 b on a.item_id == b.id and a.word == b.word;

create table hs_tmp_311 as
select b.id, a.word, b.emb, a.weight, graph_embedding:change_weight_query_key_1(a.word, a.weight) as new_weight from hs_tmp_307 a join hs_tmp_309 b on a.index == b.id and a.word == b.word;

create table hs_dssm_dic_query_10 as
select b.id, a.word, b.emb, a.weight, graph_embedding:change_weight_query_key_1(a.word, a.weight) as new_weight from hs_dssm_dic_query_8 a join hs_dssm_dic_query_9 b on a.query_id == b.id and a.word == b.word;


create table hs_tmp_312 as
select id, return_concat_1(new_weight, emb) as title_emb from hs_tmp_310 group by id;

create table hs_tmp_313 as
select id, return_concat_1(new_weight, emb) as query_emb from hs_tmp_311 group by id;

create table hs_dssm_dic_query_11 as
select id, return_concat_1(new_weight, emb) as query_emb from hs_dssm_dic_query_10 group by id;


train_set : | se_keyword_mainse_ws | title_mainse_ws | label |
-> "se_keyword_mainse_ws,title_mainse_ws, pic_mainse_ws, label"

drop table hs_tmp_314;
yes
create table hs_tmp_314 as select e.query_emb as se_keyword_mainse_ws, e.title_emb as title_mainse_ws, f.pic_emb as pic_mainse_ws, e.label from (select c., d.title_emb from (select a., b.query_emb from hs_tmp_300 a join hs_tmp_313 b on a.index == b.id)c join hs_tmp_312 d on c.item_id == d.id)e join hs_tmp_348 f on e.item_id == f.item_id;

drop table hs_train_data_dssm_v2_8;
yes
drop table hs_test_data_dssm_v2_8;
yes
PAI -name split -project algo_public
-DinputTableName=graph_embedding.hs_tmp_314
-Doutput1TableName=graph_embedding.hs_train_data_dssm_v2_8
-Doutput2TableName=graph_embedding.hs_test_data_dssm_v2_8
-Dfraction=0.9
-DmemSizePerCore=4096
-DcoreNum=100
;

开始训练

pai -name tensorflow140 -Dscript="file:///home/hengsong/origin_deep_cluster_odps_8.tar.gz" -DentryFile="train_inference_v8.py" -Dcluster='{"worker":{"count":50, "cpu":200, "memory":4000}, "ps":{"count":10, "cpu":200, "memory":5000}}' -DuseSparseClusterSchema=True -DenableDynamicCluster=True -Dtables="odps://graph_embedding/tables/hs_train_data_dssm_v2_7,odps://graph_embedding/tables/hs_test_data_dssm_v2_7,odps://graph_embedding/tables/hs_tmp_267" -Doutputs="odps://graph_embedding/tables/hs_dssm_result_4" -DcheckpointDir="oss://bucket-automl/hengsong/?role_arn=acs:ram::1293303983251548:role/graph2018&host=cn-hangzhou.oss-internal.aliyun-inc.com" -DuserDefinedParameters="--learning_rate=3e-4 --batch_size=1024 --is_save_model=True --attention_type=1 --num_epochs=1 --ckpt=hs_ugc_video_4e_8.ckpt-1" -DuseSparseClusterSchema=True;

num_epoch : 10

pai -name tensorflow140 -Dscript="file:///home/hengsong/origin_deep_cluster_odps_8.tar.gz" -DentryFile="train_inference_v9.py" -Dcluster='{"worker":{"count":1, "cpu":200, "memory":4000}, "ps":{"count":1, "cpu":200, "memory":5000}}' -DuseSparseClusterSchema=True -DenableDynamicCluster=True -Dtables="odps://graph_embedding/tables/hs_train_data_dssm_v2_7,odps://graph_embedding/tables/hs_test_data_dssm_v2_7,odps://graph_embedding/tables/hs_tmp_267" -Doutputs="odps://graph_embedding/tables/hs_dssm_result_5" -DcheckpointDir="oss://bucket-automl/hengsong/?role_arn=acs:ram::1293303983251548:role/graph2018&host=cn-hangzhou.oss-internal.aliyun-inc.com" -DuserDefinedParameters="--learning_rate=3e-4 --batch_size=1024 --is_save_model=True --attention_type=1 --num_epochs=1 --ckpt=hs_ugc_video_4e_10.ckpt" -DuseSparseClusterSchema=True;

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,928评论 6 509
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,748评论 3 396
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 166,282评论 0 357
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 59,065评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,101评论 6 395
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,855评论 1 308
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,521评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,414评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,931评论 1 319
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,053评论 3 340
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,191评论 1 352
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,873评论 5 347
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,529评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,074评论 0 23
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,188评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,491评论 3 375
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,173评论 2 357

推荐阅读更多精彩内容

  • 昨天工作:在dssm网络的基础上增加了self attention模块。构造训练测试数据。网络训练效果较修改前有所...
    Songger阅读 289评论 1 0
  • 上周五工作: 使用手肘法测试top 1w query最佳聚类类别数,但是在这一数据中,sse斜率变化不大,分析的原...
    Songger阅读 311评论 0 0
  • set odps.sql.mapper.split.size=1;昨天工作: 重新处理数据集,给一些重要的关键词,...
    Songger阅读 270评论 0 0
  • 哪些图片需要保留?image_position > 0 and image_position < 6 and ty...
    Songger阅读 548评论 0 0
  • tips: 将验证集中的query进行一下筛选 测试一下正负样本权重的作用 在之前的模型上测试一下效果 使用输出分...
    Songger阅读 250评论 0 0