24小时热门版块排行榜    

查看: 901  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 306求调剂 +8 chuanzhu川烛 2026-03-18 8/400 2026-03-23 12:45 by lovewei0727
[考研] 081700 调剂 267分 +3 迷人的哈哈 2026-03-23 3/150 2026-03-23 11:16 by barlinike
[考研] 280分求调剂 一志愿085802 +4 PUMPT 2026-03-22 7/350 2026-03-22 22:13 by 星空星月
[考研] 一志愿西安交通大学材料工程专业 282分求调剂 +11 枫桥ZL 2026-03-18 13/650 2026-03-22 20:26 by edmund7
[考研] 289材料与化工(085600)B区求调剂 +3 这么名字咋样 2026-03-22 4/200 2026-03-22 17:56 by 云民大李老师
[考研] 求调剂 +7 Auroracx 2026-03-22 7/350 2026-03-22 12:38 by 素颜倾城1988
[考研] 工科0856求调剂 +3 沐析汀汀 2026-03-21 3/150 2026-03-21 18:30 by 学员8dgXkO
[考研] 【考研调剂】化学专业 281分,一志愿四川大学,诚心求调剂 +11 吃吃吃才有意义 2026-03-19 11/550 2026-03-21 18:23 by 学员8dgXkO
[考研] 336求调剂 +5 rmc8866 2026-03-21 5/250 2026-03-21 17:24 by 学员8dgXkO
[考研] 一志愿重庆大学085700资源与环境总分308求调剂 +7 墨墨漠 2026-03-20 7/350 2026-03-21 16:36 by barlinike
[考研] 22 350 本科985求调剂,求老登收留 +3 李轶男003 2026-03-20 3/150 2026-03-21 13:28 by 搏击518
[考研] 330求调剂0854 +3 assdll 2026-03-21 3/150 2026-03-21 13:01 by 搏击518
[考研] 085601调剂 358分 +3 zzzzggh 2026-03-20 4/200 2026-03-21 10:21 by luoyongfeng
[考研] 274求调剂 +10 S.H1 2026-03-18 10/500 2026-03-20 23:51 by JourneyLucky
[考研] 329求调剂 +9 想上学吖吖 2026-03-19 9/450 2026-03-20 22:01 by luoyongfeng
[考研] 广西大学家禽遗传育种课题组2026年硕士招生(接收计算机专业调剂) +3 123阿标 2026-03-17 3/150 2026-03-20 15:58 by 飞行琦
[考研] 生物学调剂招人!!! +3 山海天岚 2026-03-17 4/200 2026-03-19 21:34 by 怎么释怀
[考博] 申博26年 +3 八6八68 2026-03-19 3/150 2026-03-19 19:43 by nxgogo
[考研] 【同济软件】软件(085405)考研求调剂 +3 2026eternal 2026-03-18 3/150 2026-03-18 19:09 by 搏击518
[考研] 考研调剂 +3 淇ya_~ 2026-03-17 5/250 2026-03-17 09:25 by Winj1e
信息提示
请填处理意见