Skip to content

Commit 32f88fc

Browse files
shenweichen浅梦
shenweichen
authored and
浅梦
committed
update doc
1 parent db66ac3 commit 32f88fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/source/Examples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ if __name__ == "__main__":
246246

247247
use_weighted_sequence = False
248248
if use_weighted_sequence:
249-
data['genres_weight'] = np.random.randn(data.shape[0])
250249
varlen_feature_columns = [VarLenSparseFeat('genres', len(
251250
key2index) + 1, max_len, 'mean',weight_name='genres_weight')] # Notice : value 0 is for padding for sequence input feature
252251
else:
@@ -260,8 +259,9 @@ if __name__ == "__main__":
260259

261260

262261
# 3.generate input data for model
263-
model_input = {name:data[name] for name in feature_names}#
262+
model_input = {name:data[name] for name in sparse_features}#
264263
model_input["genres"] = genres_list
264+
model_input["genres_weight"] = np.random.randn(data.shape[0],max_len,1)
265265

266266

267267
# 4.Define Model,compile and train

examples/run_multivalue_movielens.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def split(x):
4141

4242
use_weighted_sequence = False
4343
if use_weighted_sequence:
44-
data['genres_weight'] = np.random.randn(data.shape[0])
4544
varlen_feature_columns = [VarLenSparseFeat('genres', len(
4645
key2index) + 1, max_len, 'mean',weight_name='genres_weight')] # Notice : value 0 is for padding for sequence input feature
4746
else:
@@ -55,8 +54,9 @@ def split(x):
5554

5655

5756
# 3.generate input data for model
58-
model_input = {name:data[name] for name in feature_names}#
57+
model_input = {name:data[name] for name in sparse_features}#
5958
model_input["genres"] = genres_list
59+
model_input["genres_weight"] = np.random.randn(data.shape[0],max_len,1)
6060

6161

6262
# 4.Define Model,compile and train

0 commit comments

Comments
 (0)