be65ce986a45bf2f35b5494db3fa6e993b905aeb,tests/models/DIN_test.py,,get_xy_fd,#Any#,9
Before Change
def get_xy_fd(hash_flag=False):
feature_dim_dict = {"sparse": [SingleFeat("user", 3, hash_flag), SingleFeat(
"gender", 2, hash_flag), SingleFeat("item", 3 + 1, hash_flag), SingleFeat("item_gender", 2 + 1, hash_flag)],
"dense": [SingleFeat("score", 0)]}
behavior_feature_list = ["item", "item_gender"]
uid = np.array([0, 1, 2])
ugender = np.array([0, 1, 0])
iid = np.array([1, 2, 3]) // 0 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]])
feature_dict = {"user": uid, "gender": ugender, "item": iid, "item_gender": igender,
"hist_item": hist_iid, "hist_item_gender": hist_igender, "score": score}
x = [feature_dict[feat.name] for feat in feature_dim_dict["sparse"]] + [feature_dict[feat.name] for feat in
feature_dim_dict["dense"]] + [
feature_dict["hist_" + feat] for feat in behavior_feature_list]
y = [1, 0, 1]
return x, y, feature_dim_dict, behavior_feature_list
After Change
"hist_item": hist_iid, "hist_item_gender": hist_igender, "score": score}
feature_names = get_fixlen_feature_names(feature_columns)
varlen_feature_names = get_varlen_feature_names(feature_columns)
x = [feature_dict[name] for name in feature_names] + [feature_dict[name] for name in varlen_feature_names]
// x = [feature_dict[feat.name] for feat in feature_dim_dict["sparse"]] + [feature_dict[feat.name] for feat in
// feature_dim_dict["dense"]] + [
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: shenweichen/DeepCTR
Commit Name: be65ce986a45bf2f35b5494db3fa6e993b905aeb
Time: 2019-06-30
Author: wcshen1994@163.com
File Name: tests/models/DIN_test.py
Class Name:
Method Name: get_xy_fd
Project Name: shenweichen/DeepCTR
Commit Name: be65ce986a45bf2f35b5494db3fa6e993b905aeb
Time: 2019-06-30
Author: wcshen1994@163.com
File Name: examples/run_din.py
Class Name:
Method Name: get_xy_fd
Project Name: NifTK/NiftyNet
Commit Name: 6b48055fdfe3c628833ed26ca394ef2fb1d97f82
Time: 2017-10-26
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/resampler.py
Class Name: ResamplerLayer
Method Name: _resample_nearest