20190723工作進(jìn)展

  1. rm -rf ../../origin_deep_cluster_odps_8.tar.gz
    tar -cvzf ../../origin_deep_cluster_odps_8.tar.gz *

sudo docker run -ti --name hengsong2 -v /Users/songge/Desktop/beifen/hengsong.lhs:/home/hengsong --net=host reg.docker.alibaba-inc.com/zhiji/imgtoolkit_video:nightly-dev bash

  1. docker 的 java 環(huán)境

source /etc/profile

JAVA_HOME=/home/hengsong/jdk1.8.0_221
JRE_HOME=JAVA_HOME/jre PATH=PATH:JAVA_HOME/bin CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH

  1. 給闊姐的表

graph_embedding.jl_jingyan_query_related_video_pool
where type_biz=2
body里的 item_id, ugc_old_memo/s":"feedback","text/s": video_url, video_id 字段

create table hs_jingyan_query_related_video_pool_ugc as
select id, coalesce(CONCAT('http://cloud.video.taobao.com', get_json_object(body, '.entities.k2.play_url/s')),CONCAT('http:', get_json_object(body, '.entities.k3.play_url/s')))as video_url, coalesce(get_json_object(body, '.entities.k3.video_id/l'), get_json_object(body, '.entities.k2.video_id/l')) as video_id, coalesce(get_json_object(body, '.entities.k1.item_id/l') ,get_json_object(body, '.entities.k0.item_id/l') )as item_id, coalesce(get_json_object(body, '.entities.k2.text/s'),get_json_object(body, '.entities.k1.text/s')) as text
from graph_embedding.jl_jingyan_query_related_video_pool where ds=max_pt('graph_embedding.jl_jingyan_query_related_video_pool') and type_biz=2;

graph_embedding.hs_jingyan_query_related_video_pool_ugc

  1. 得到負(fù)采樣

hs_tmp_dssm_6

hs_tmp_dssm_index_1
hs_tmp_dssm_item_id_1
create table hs_tmp_36 as select item_id from hs_tmp_dssm_6;
create table hs_tmp_dssm_item_id_1 as select int(rand() * 135525) as randint, item_id from hs_tmp_36;
(5 * ) insert into table hs_tmp_dssm_item_id_1 select int(rand() * 135525) as randint, item_id from hs_tmp_36;

hs_tmp_dssm_8
create table hs_tmp_dssm_8 as
select a.index, b.item_id from
(select index from hs_tmp_dssm_index_1)a join (select * from hs_tmp_dssm_item_id_1)b on a.index == b.randint % 5421;

select index, count(*) as freq from hs_tmp_dssm_8 group by index order by freq desc limit 10;

去重

hs_tmp_dssm_9->hs_tmp_dssm_10

create table hs_tmp_dssm_9 as select a.*, b.index as indexb, b.item_id as item_idb from (select * from hs_tmp_dssm_8)a left join (select * from hs_tmp_dssm_6)b on a.index=b.index and a.item_id=b.item_id;

create table hs_tmp_dssm_10 as select index, item_id, 0 as label from hs_tmp_dssm_9 where indexb is NULL and item_idb is NULL;

create table hs_tmp_dssm_11 as select index, item_id, 1 as label from hs_tmp_dssm_6;

得到樣本集合
positive samples : hs_tmp_dssm_11
negetive samples : hs_tmp_dssm_10

亂序
insert into table hs_tmp_dssm_11 select * from hs_tmp_10;
create table hs_tmp_38 as select int(rand() * 11000000000) as id, * from hs_tmp_dssm_11;
create table hs_tmp_dssm_12 as select index, item_id, label from hs_tmp_38 order by id;

create table hs_tmp_dssm_13 as select * from hs_tmp_38 order by id;

下面這個(gè)更好:

drop table hs_tmp_dssm_12;
yes
create table hs_tmp_dssm_12 lifecycle 30 as select * from hs_tmp_dssm_13 DISTRIBUTE by random();

drop table hs_tmp_dssm_13;
yes
create table hs_tmp_dssm_13 lifecycle 30 as select * from hs_tmp_dssm_12 DISTRIBUTE by random();

+------------+------------+
| label | freq |
+------------+------------+
| 0 | 5828333140 |
| 1 | 1171862133 |
+------------+------------+

drop table if exists graph_embedding.zj_xhs_dssm_pos_neg_sample_info_shuffle_;
create table if not exists graph_embedding.zj_xhs_dssm_pos_neg_sample_info_shuffle_ LIFECYCLE 30
as select * from graph_embedding.zj_xhs_dssm_pos_neg_sample_info_ DISTRIBUTE by random();

取得query_ws和title_ws字段:
create table hs_tmp_39 as select distinct index, se_keyword_ws from hs_tmp_dssm_3;
create table hs_tmp_40 as select distinct item_id, title_ws from hs_tmp_dssm_3;

create table hs_tmp_41 as
select a.index, a.se_keyword_ws, b.item_id, b.label from (select * from hs_tmp_39)a join (select * from hs_tmp_dssm_12)b on a.index == b.index;

create table hs_tmp_42 as
select a.title_ws, b.* from (select * from hs_tmp_40)a join (select * from hs_tmp_41)b on a.item_id == b.item_id;

訓(xùn)練數(shù)據(jù):hs_train_data_dssm_1 測(cè)試數(shù)據(jù):hs_test_data_dssm_1
drop table if exists hs_train_data_dssm_1;
yes
drop table if exists hs_test_data_dssm_1;
yes
PAI -name split -project algo_public
-DinputTableName=graph_embedding.hs_tmp_42
-Doutput1TableName=graph_embedding.hs_train_data_dssm_1
-Doutput2TableName=graph_embedding.hs_test_data_dssm_1
-Dfraction=0.8
-DmemSizePerCore=4096
-DcoreNum=300
;

判斷title補(bǔ)全長(zhǎng)度
create table hs_title_length as select REGEXP_COUNT(title_ws, ' ') as title_len, REGEXP_COUNT(se_keyword_ws, ' ') as query_len from hs_tmp_42;
總數(shù)量:7000195273

25: 129186737
30: 43367246

10: 0
取20更好一點(diǎn)

pai -name tensorflow140 -Dscript="file:///home/hengsong/origin_deep_cluster_odps_8.tar.gz" -DentryFile="train_v4.py" -Dcluster='{"worker":{"count":30, "cpu":200, "memory":4000}, "ps":{"count":30, "cpu":200, "memory":5000}}' -Dtables="odps://graph_embedding/tables/hs_train_data_dssm_1,odps://graph_embedding/tables/hs_test_data_dssm_1" -DcheckpointDir="oss://bucket-automl/hengsong/?role_arn=acs:ram::1293303983251548:role/graph2018&host=cn-hangzhou.oss-internal.aliyun-inc.com" -DuserDefinedParameters="--learning_rate=1e-2 --batch_size=2048 --is_save_model=True --attention_type=1 --num_epochs=100 --ckpt=hs_ugc_video.ckpt" -DuseSparseClusterSchema=True;

當(dāng)前進(jìn)程:

  1. 給之己的hive語句
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,362評(píng)論 6 537
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 99,013評(píng)論 3 423
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 177,346評(píng)論 0 382
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我,道長(zhǎng),這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,421評(píng)論 1 316
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 72,146評(píng)論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 55,534評(píng)論 1 325
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,585評(píng)論 3 444
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 42,767評(píng)論 0 289
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 49,318評(píng)論 1 335
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 41,074評(píng)論 3 356
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 43,258評(píng)論 1 371
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,828評(píng)論 5 362
  • 正文 年R本政府宣布,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 44,486評(píng)論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,916評(píng)論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,156評(píng)論 1 290
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 51,993評(píng)論 3 395
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 48,234評(píng)論 2 375