我有一个2D数组,我想应用softmax函数列。尝试以下方法:
value = numpy.array([[1.0,2.0], [3.0,9.0], [7.0,1.0]], dtype=theano.config.floatX)
m = theano.shared(value, name='m', borrow=True)
y = theano.tensor.nnet.softmax(m)
print y.eval()
因此,我得到以下输出:
^{pr2}$这意味着操作已按行应用。有没有办法强迫Theano按列顺序执行softmax?在
它的设计目的是: http://deeplearning.net/software/theano/library/tensor/nnet/nnet.html#theano.tensor.nnet.nnet.softmax
换位数组将得到预期的结果。不知道西亚诺这只是一个猜测:
或者:
^{pr2}$参考号:http://deeplearning.net/software/theano/library/tensor/basic.html#theano.tensor._tensor_py_operators.T
简单的解决方案:转置
对于张量rank>;=3,转置需要指定轴。在
^{pr2}$相关问题 更多 >
编程相关推荐