我試圖找到在theano的矩陣元素明智地找到 s=max(ele, 0)
的值。 我對theano沒有太多經驗。Theano元素明智的最大值
到目前爲止,我有
x = theano.tensor.dmatrix('x')
s = (x + abs(x))/2 # poor man's trick
linmax = function([x], s)
這工作,但不漂亮,我想我應該能夠使用theano.tensor.maximum
這一點。
在Matlab中,做我想做的事,我只想寫 [email protected](x) max (x, zeros (size (x)))
注意:'T.max()'和'T.maximum()'不等價。花了一段時間才明白! –