24小时热门版块排行榜    

Znn3bq.jpeg
查看: 915  |  回复: 3

LoseInVain

新虫 (初入文坛)

[交流] In tensorflow, how to use the placeholder's value before feeding? 已有1人参与

在stack overflow里面发了一个问题,现在还没回答比较急,所以这里求助下~~
New to TensorFlow,Now I need to use the value in placeholder before feeding, something like:

tensor = tf.placeholder(tf.float32, [None, 3])
Mat_items = tf.Variable(tf.random_normal([10,10]))
Mat_users = tf.Variable(tf.random_normal([10,10]))
item_index = tensor[:, 0]
user_index = tensor[:, 1]
rating = tensor[:, 2]
Val = Mat_items[item_index, :]-Mat_users[user_index, :]

while tensor is a placeholder with N rows 3 cols, first col and second col is the index to Mat_items and Mat_users respectively and Mat_items Mat_users are the Variables needed to be indexed.
Running it will absolutely throw an error because item_index, user_index both are Tensor not numeric before feeding. So I wonder whether Tensorflow could realize this demand? Any suggestion will be appreciate!
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

uerth

铁虫 (小有名气)

2楼2017-06-22 17:25:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

LoseInVain

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by uerth at 2017-06-22 17:25:21
keras

这个会比较适合这种问题吗?

发自小木虫Android客户端
3楼2017-06-23 14:12:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

uerth

铁虫 (小有名气)

4楼2017-06-23 16:42:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 LoseInVain 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 求调剂学校 +14 不会吃肉 2026-04-13 16/800 2026-04-15 21:59 by noqvsozv
[考研] 291分调剂 +11 上岸小莹加油 2026-04-09 12/600 2026-04-15 21:55 by noqvsozv
[考研] 307中医考研调剂 +4 于以采蘩 2026-04-14 4/200 2026-04-15 19:14 by AN流800
[考研] 一志愿沪9,生物学326求调剂 +7 刘墨墨 2026-04-15 7/350 2026-04-15 18:51 by 浮云166
[考研] 材料工程281还有调剂机会吗 +43 xaw. 2026-04-11 44/2200 2026-04-15 12:46 by 西北望—风沙
[考研] 105500药学求调剂 +4 x_skys 2026-04-12 4/200 2026-04-14 13:37 by rndfc
[考研] 305求调剂 +8 玛卡巴卡boom 2026-04-11 8/400 2026-04-14 09:04 by pengliang8036
[考研] 机械还有还有名额吗?太难了 +8 笑笑袁 2026-04-10 8/400 2026-04-14 08:44 by screening
[考研] 考研英一数一338分 +9 长江大学东校区 2026-04-13 10/500 2026-04-14 00:41 by 王珺璞
[考研] 求调剂 +12 璃茉一定上岸 2026-04-10 13/650 2026-04-14 00:08 by Equinoxhua
[考研] 本科西工大 324求调剂 +5 wysyjs25 2026-04-10 5/250 2026-04-13 23:08 by pies112
[考研] 290求调剂 +18 柯淮然 2026-04-12 20/1000 2026-04-13 12:56 by cyh—315
[考研] 0831生医工第一轮调剂失败求助 +12 小熊睿睿_s 2026-04-11 16/800 2026-04-12 16:28 by 钰璞
[考研] 电气工程专硕320求调剂 +5 小麻子111 2026-04-10 5/250 2026-04-12 10:47 by zhouyuwinner
[考研] 材料与化工300求调剂 +39 肖开文 2026-04-09 43/2150 2026-04-12 01:30 by 秋豆菜芽
[考研] 0854调剂 +5 音像店听花鼓戏 2026-04-10 5/250 2026-04-11 10:49 by qingpingzhu
[考研] 297求调剂 +9 Kwgyz 2026-04-09 9/450 2026-04-11 10:09 by zhq0425
[考研] 广东省 085601 329分求调剂 +14 Eddieddd 2026-04-10 14/700 2026-04-11 09:58 by bljnqdcc
[考研] 301求调剂 +5 149. 2026-04-10 5/250 2026-04-10 15:45 by 柴小白
[考研] 青岛科技大学材料学院,环境学院调剂补录4月10日以前都可以 +3 1青科大。 2026-04-09 5/250 2026-04-10 09:58 by 翩翩一书生
信息提示
请填处理意见