We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
session 1.
def build_model(): model = RetrievalModel(item_model, user_model) learning_rate = 0.01 model.compile(optimizer=tf.keras.optimizers.Adagrad(learning_rate)) return model
model = build_model() model.fit(behavior_dataset, epochs=30) model.save_weights(save_path,overwrite=True )
compute_loss_args = { "user_id" : tf.constant(["45"]), "work_id" : tf.constant(["45"]), "tags" : tf.constant([""]), "work_uid" : tf.constant(["45"]), "money_goods" : tf.constant([100]), "category_id" : tf.constant(["2"]), "bid_type" : tf.constant(["normal"]), "is_rec" : tf.constant(["1"]), "weights" : tf.constant([1]), } model(compute_loss_args) s = model.load_weights(save_path ).expect_partial()
k = 100 user_id = '1035369' index = tfrs.layers.factorized_top_k.BruteForce(model.user_model,k) index.index_from_dataset( work_dataset.shuffle(100_100).map(lambda x: (x["work_id"], model.item_model(x))) #注意,这里是全局可推荐列表 ) print(f"rec user_id :{user_id}") print(user_id in unique_user_id)
is right。
session 2:
is wrong 不准确。
tensorboard 2.15.2 keras 2.15.0
The text was updated successfully, but these errors were encountered:
colab can is right ,but same version pip list my pc is wrong
Sorry, something went wrong.
No branches or pull requests
session 1.
def build_model():
model = RetrievalModel(item_model, user_model)
learning_rate = 0.01
model.compile(optimizer=tf.keras.optimizers.Adagrad(learning_rate))
return model
model = build_model()
model.fit(behavior_dataset, epochs=30)
model.save_weights(save_path,overwrite=True )
compute_loss_args = {
"user_id" : tf.constant(["45"]),
"work_id" : tf.constant(["45"]),
"tags" : tf.constant([""]),
"work_uid" : tf.constant(["45"]),
"money_goods" : tf.constant([100]),
"category_id" : tf.constant(["2"]),
"bid_type" : tf.constant(["normal"]),
"is_rec" : tf.constant(["1"]),
"weights" : tf.constant([1]),
}
model(compute_loss_args)
s = model.load_weights(save_path ).expect_partial()
k = 100
user_id = '1035369'
index = tfrs.layers.factorized_top_k.BruteForce(model.user_model,k)
index.index_from_dataset(
work_dataset.shuffle(100_100).map(lambda x: (x["work_id"], model.item_model(x))) #注意,这里是全局可推荐列表
)
print(f"rec user_id :{user_id}")
print(user_id in unique_user_id)
is right。
session 2:
def build_model():
model = RetrievalModel(item_model, user_model)
learning_rate = 0.01
model.compile(optimizer=tf.keras.optimizers.Adagrad(learning_rate))
return model
compute_loss_args = {
"user_id" : tf.constant(["45"]),
"work_id" : tf.constant(["45"]),
"tags" : tf.constant([""]),
"work_uid" : tf.constant(["45"]),
"money_goods" : tf.constant([100]),
"category_id" : tf.constant(["2"]),
"bid_type" : tf.constant(["normal"]),
"is_rec" : tf.constant(["1"]),
"weights" : tf.constant([1]),
}
model(compute_loss_args)
s = model.load_weights(save_path ).expect_partial()
k = 100
user_id = '1035369'
index = tfrs.layers.factorized_top_k.BruteForce(model.user_model,k)
index.index_from_dataset(
work_dataset.shuffle(100_100).map(lambda x: (x["work_id"], model.item_model(x))) #注意,这里是全局可推荐列表
)
print(f"rec user_id :{user_id}")
print(user_id in unique_user_id)
is wrong 不准确。
tensorboard 2.15.2
keras 2.15.0
The text was updated successfully, but these errors were encountered: