24小时热门版块排行榜    

Znn3bq.jpeg
查看: 916  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 271求调剂 +35 2261744733 2026-04-11 37/1850 2026-04-16 13:16 by jiahl2024
[考研] 327求调剂 +26 Xxjc1107. 2026-04-13 29/1450 2026-04-16 10:52 by Espannnnnol
[考研] 22408 312求调剂 +21 门路摸摸 2026-04-14 22/1100 2026-04-16 10:51 by 阿文超
[考研] 307中医考研调剂 +5 于以采蘩 2026-04-14 5/250 2026-04-16 10:40 by dick_runner
[考研] 求调剂学校 +14 不会吃肉 2026-04-13 16/800 2026-04-15 21:59 by noqvsozv
[考研] 求助调剂,跨调 +19 X十甫寸Y 2026-04-11 20/1000 2026-04-15 21:18 by cuisz
[考研] 310求调剂 +16 666真好 2026-04-11 18/900 2026-04-15 13:28 by 黑科技矿业
[考研] 食品与营养(0955)271求调剂 +15 升格阿达 2026-04-12 16/800 2026-04-14 13:18 by 浮若_安生
[考研] 人工智能320调剂08工类还有机会吗 +18 振—TZ 2026-04-10 19/950 2026-04-14 10:34 by screening
[考研] 农学0904 312求调剂 +4 Say Never 2026-04-11 4/200 2026-04-14 09:10 by zs92450
[考研] 300分求调剂 (085501机械专硕,本科扬大) +9 xu@841019 2026-04-11 10/500 2026-04-14 08:48 by 木木mumu~
[考研] 0856专硕求调剂 希望是a区院校 +24 好好休息好不好 2026-04-09 27/1350 2026-04-13 22:22 by pies112
[考研] 0854调剂 +10 长弓傲 2026-04-11 11/550 2026-04-13 10:38 by wp06
[考研] 求调剂288 +7 ioodiiij 2026-04-10 9/450 2026-04-13 08:33 by Hayaay
[考研] 0831一轮调剂失败求助 +10 小熊睿睿_s 2026-04-11 10/500 2026-04-12 22:43 by 长弓傲
[考研] 307求调剂 +10 tzq94092 2026-04-10 10/500 2026-04-12 08:18 by wise999
[考研] 359求调剂 +5 胃痉挛累了 2026-04-11 5/250 2026-04-11 19:55 by lbsjt
[考研] 化学工程与技术324调剂 +23 孙常华 2026-04-09 25/1250 2026-04-11 00:07 by 骑牛渡寒江
[考研] 一志愿京区985,085401,与本科专业一致,电子信息工程, +4 阳光开朗的男孩 2026-04-10 4/200 2026-04-10 18:27 by shenrf
[考研] 机械专368 有去处吗 +4 种大树 2026-04-10 4/200 2026-04-10 15:31 by jiajinhpu
信息提示
请填处理意见