24小时热门版块排行榜    

查看: 866  |  回复: 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的回帖

uerth

铁虫 (小有名气)

4楼2017-06-23 16:42:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 LoseInVain 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见