dcf583f15d08415d4e1972d44c250a5f13f6b10c,tests/models/DIEN_test.py,,get_xy_fd,#,10
Before Change
SparseFeat("item_gender", 2+1,hash_flag),
DenseFeat("score", 1)]
feature_columns += [VarLenSparseFeat("hist_item", maxlen=4,vocabulary_size=3+1, embedding_name="item"),
VarLenSparseFeat("hist_item_gender", maxlen=4,vocabulary_size=3+1, embedding_name="item_gender")]
behavior_feature_list = ["item","item_gender"]
uid = np.array([0, 1, 2])
ugender = np.array([0, 1, 0])
iid = np.array([1, 2, 3])/ǖ is mask value
igender = np.array([1, 2, 1])// 0 is mask value
score = np.array([0.1, 0.2, 0.3])
hist_iid = np.array([[ 1, 2, 3,0], [ 1, 2, 3,0], [ 1, 2, 0,0]])
hist_igender = np.array([[1, 1, 2,0 ], [2, 1, 1, 0], [2, 1, 0, 0]])
behavior_length = np.array([3,3,2])
feature_dict = {"user": uid, "gender": ugender, "item": iid, "item_gender": igender,
"hist_item": hist_iid, "hist_item_gender": hist_igender,
"score": score}
if use_neg:
feature_dict["neg_hist_item"] = np.array([[1, 2, 3, 0], [1, 2, 3, 0], [1, 2, 0, 0]])
feature_dict["neg_hist_item_gender"] = np.array([[1, 1, 2, 0], [2, 1, 1, 0], [2, 1, 0, 0]])
feature_columns += [VarLenSparseFeat("neg_hist_item", maxlen=4,vocabulary_size=3+1, embedding_name="item"),
VarLenSparseFeat("neg_hist_item_gender", maxlen=4,vocabulary_size=3+1, embedding_name="item_gender")]
feature_names = get_feature_names(feature_columns)
x = {name:feature_dict[name] for name in feature_names}
x["seq_length"] = behavior_length
y = [1, 0, 1]
After Change
SparseFeat("item_gender", 2+1,hash_flag),
DenseFeat("score", 1)]
feature_columns += [
VarLenSparseFeat(SparseFeat("hist_item", vocabulary_size=3 + 1, embedding_dim=8, embedding_name="item"),
maxlen=4),
VarLenSparseFeat(SparseFeat("hist_item_gender", 2 + 1, embedding_dim=4, embedding_name="item_gender"), maxlen=4)]
behavior_feature_list = ["item","item_gender"]
uid = np.array([0, 1, 2])
ugender = np.array([0, 1, 0])
iid = np.array([1, 2, 3])/ǖ is mask value
igender = np.array([1, 2, 1])// 0 is mask value
score = np.array([0.1, 0.2, 0.3])
hist_iid = np.array([[ 1, 2, 3,0], [ 1, 2, 3,0], [ 1, 2, 0,0]])
hist_igender = np.array([[1, 1, 2,0 ], [2, 1, 1, 0], [2, 1, 0, 0]])
behavior_length = np.array([3,3,2])
feature_dict = {"user": uid, "gender": ugender, "item": iid, "item_gender": igender,
"hist_item": hist_iid, "hist_item_gender": hist_igender,
"score": score}
if use_neg:
feature_dict["neg_hist_item"] = np.array([[1, 2, 3, 0], [1, 2, 3, 0], [1, 2, 0, 0]])
feature_dict["neg_hist_item_gender"] = np.array([[1, 1, 2, 0], [2, 1, 1, 0], [2, 1, 0, 0]])
feature_columns += [
VarLenSparseFeat(SparseFeat("neg_hist_item", vocabulary_size=3 + 1, embedding_dim=8, embedding_name="item"),
maxlen=4),
VarLenSparseFeat(SparseFeat("neg_hist_item_gender", 2 + 1, embedding_dim=4, embedding_name="item_gender"),
maxlen=4)]
feature_names = get_feature_names(feature_columns)
x = {name:feature_dict[name] for name in feature_names}
x["seq_length"] = behavior_length
y = [1, 0, 1]
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 6
Instances
Project Name: shenweichen/DeepCTR
Commit Name: dcf583f15d08415d4e1972d44c250a5f13f6b10c
Time: 2020-01-27
Author: wcshen1994@163.com
File Name: tests/models/DIEN_test.py
Class Name:
Method Name: get_xy_fd
Project Name: shenweichen/DeepCTR
Commit Name: dcf583f15d08415d4e1972d44c250a5f13f6b10c
Time: 2020-01-27
Author: wcshen1994@163.com
File Name: tests/models/DSIN_test.py
Class Name:
Method Name: get_xy_fd
Project Name: shenweichen/DeepCTR
Commit Name: dcf583f15d08415d4e1972d44c250a5f13f6b10c
Time: 2020-01-27
Author: wcshen1994@163.com
File Name: examples/run_dsin.py
Class Name:
Method Name: get_xy_fd
Project Name: shenweichen/DeepCTR
Commit Name: dcf583f15d08415d4e1972d44c250a5f13f6b10c
Time: 2020-01-27
Author: wcshen1994@163.com
File Name: tests/models/DIN_test.py
Class Name:
Method Name: get_xy_fd