【发布时间】:2017-03-17 09:19:50
【问题描述】:
以下结果是线性回归[y = Wx + b]的numpy ndarray分数。
scores = tf.nn.xw_plus_b(self.h_drop, W, b, name='scores')
~ ~ .....
all_scores = np.zeros(shape=(0,len(label_dict)))
~~...
all_scores = np.concatenate((all_scores, batch_scores) , axis=0)
如何将上面的 numpy ndarray 值更改为 ndarray 概率值?
想要的结果:
col0 col1 col2 col3 col4 col5
Row1 0.02 | 0.123 | 0.678 | 0.067 | 0.0987 | 0.1089 : Sum(col0~5) = 1
~
【问题讨论】:
-
什么概率?
-
我想将结果值的每个值转换为概率值,例如上面的“期望结果”[all_scores:ndarray values]。
标签: python python-3.x numpy tensorflow