| ²é¿´: 991 | »Ø¸´: 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! |
» ²ÂÄãϲ»¶
»ù½ðδÖУ¬ÕâÖÖ´ð¸´ÊÇÄ£°åÂð£¿
ÒѾÓÐ5È˻ظ´
Ϊʲô×ÊÖúÊý¸÷´ó¸ßУ¶¼´´Ð¸ߣ¬×Ô¼ºÉêÇëÔõô¾ÍÕâôÄÑ
ÒѾÓÐ5È˻ظ´
ÓжàÉÙÈËÊǽñÌì²éϵͳ֪µÀ½á¹ûµÄ£¿
ÒѾÓÐ17È˻ظ´
µ¼Ê¦Í²ۣºÎÒÔõô̯ÉÏÁËÕâô¸ö¼«Æ·Ñо¿Éú£¡
ÒѾÓÐ5È˻ظ´
Ôõô¿´Çà»ùÖÐÁËûÓа¡
ÒѾÓÐ5È˻ظ´
ÃÎÏë
ÒѾÓÐ3È˻ظ´
ÃæÉϺÏ×÷µ¥Î»¸ÇÕÂ
ÒѾÓÐ3È˻ظ´
¿´°åÉÏÕâô¶àÖеģ¬ÓеãÏñ50ÈËȺÀï49¸öÈ˶¼ÊÇÆ×ÓµÄÄÇÖָоõ¡¡
ÒѾÓÐ5È˻ظ´
»ù½ð²»ÖУ¬¹²Ãã
ÒѾÓÐ7È˻ظ´
Ϊʲô ¹ú¼Ê(µØÇø)ºÏ×÷Óë½»Á÷ÏîÄ¿ ûÓзŰñ£¿
ÒѾÓÐ11È˻ظ´
uerth
Ìú³æ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 1805.4
- ºì»¨: 1
- Ìû×Ó: 189
- ÔÚÏß: 188.2Сʱ
- ³æºÅ: 2830772
- ×¢²á: 2013-11-27
- ÐÔ±ð: GG
- רҵ: ÐÅÏ¢´¦Àí·½·¨Óë¼¼Êõ
2Â¥2017-06-22 17:25:21
LoseInVain
гæ (³õÈëÎÄ̳)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 99.5
- Ìû×Ó: 6
- ÔÚÏß: 11.7Сʱ
- ³æºÅ: 4308259
- ×¢²á: 2015-12-23
- ÐÔ±ð: GG
- רҵ: ÐÅÏ¢´¦Àí·½·¨Óë¼¼Êõ
3Â¥2017-06-23 14:12:57
uerth
Ìú³æ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 1805.4
- ºì»¨: 1
- Ìû×Ó: 189
- ÔÚÏß: 188.2Сʱ
- ³æºÅ: 2830772
- ×¢²á: 2013-11-27
- ÐÔ±ð: GG
- רҵ: ÐÅÏ¢´¦Àí·½·¨Óë¼¼Êõ
4Â¥2017-06-23 16:42:17









»Ø¸´´ËÂ¥
10