나는 부울 값이 주어진 벡터의 최대 값을 얻으려고한다. NumPy와 함께Theano :이 경우 색인 생성이 실패하는 이유는 무엇입니까?
:
>>> this = np.arange(10)
>>> this[~(this>=5)].max()
4
그러나 Theano와
가 :>>> that = T.arange(10, dtype='int32')
>>> that[~(that>=5)].max().eval()
9
>>> that[~(that>=5).nonzero()].max().eval()
Traceback (most recent call last):
File "<pyshell#146>", line 1, in <module>
that[~(that>=5).nonzero()].max().eval()
AttributeError: 'TensorVariable' object has no attribute 'nonzero'
왜 이런 일이 무엇입니까? 이게 미묘한 뉘앙스 야 내가 누락 된거야?
/속성을 사용하므로 numpy 배열을 사용하는 것과 같은 방식으로 사용할 수 없습니다. –
@JeffTratner : 웹 사이트에서 제공되는 [예제] (http://deeplearning.net/software/theano/library/tensor/basic.html#indexing)와 반대되는 것은 ... –
@NoobSailbot은 오른쪽을 사용하고 있습니까? 번역? –