theano.scan

    0熱度

    1回答

    我正在嘗試爲序列中的所有令牌提取RNN的決定,但收到帖子結尾處提到的錯誤。 任何幫助將不勝感激! 代碼: # gated recurrent unit def gru_step(x, h_prev, W_xm, W_hm, W_xh, W_hh): m = theano.tensor.nnet.sigmoid(theano.tensor.dot(x, W_xm) + theano.te

    0熱度

    1回答

    中實施遞推等式(找到與HTK類似的德爾塔係數)我想實現下面的迴歸函數,其中用作的表達式以計算德爾塔係數。但是,我不知道如何將前面的輸入傳遞到當前步驟。 其中是在時間增量係數在相應的靜態係數到方面計算的。 的值使用配置參數DELTAWINDOW進行設置。除了在這種情況下窗口大小由ACCWINDOW設置之外,將相同公式應用於增量係數以獲得加速度係數。由於方程5.16依賴於過去和將來的語音參數值,所以在

    0熱度

    1回答

    我對theano.scan()感到困惑。我已閱讀官方文件,但我仍然覺得我的知識是有限的。我想更改theano.scan中給出的功能的輸入。例如,我有以下代碼。 def forward_prop_step(x_t, s_t1_prev, s_t2_prev): # i have my code here [o, s, s2], updates = theano.scan(

    0熱度

    2回答

    這是我在theano代碼 max_max=200 beReplaced=T.matrix() toReplace=T.matrix() timeArray=T.arange(max_max) def f(v,k,w): return T.concatenate([w[:k],v,w[k+1:]],axis=0) result,_=theano.scan(f,

    1熱度

    1回答

    我有一個大小爲(5,7,3)的矩陣A和大小爲(5,3,8)的矩陣B.我想把它們乘以C = A.B,C的大小是(5,7,8)。 這意味着矩陣A中一個尺寸爲(7,3)的2D子矩陣將分別乘以矩陣B中尺寸爲(3,8)的一個2D子矩陣。所以我必須乘以5次。 最簡單的方法是使用一個循環,並numpy的: for u in range(5): C[u] = numpy.dot(A[u],B[u])

    1熱度

    1回答

    我有一個奇怪的錯誤,在編譯Theano中的掃描運算符時我無法理解。 當outputs_info與最後的尺寸等於一個初始化的,我得到這個錯誤: TypeError: ('The following error happened while compiling the node', forall_inplace,cpu, scan_fn}(TensorConstant{4}, IncSubtenso

    0熱度

    1回答

    Win 10 x64,conda,theano 0.9,python 3.6.1,spyder 3.1.4,IPython 6.0.0 當我在掃描API中測試代碼教程Iterating over the first dimension of a tensor: Calculating a polynomial,即 import theano import numpy as np import

    2熱度

    1回答

    我正在寫一個簡單的代碼來計算索引列表的單熱編碼。 例如:[1,2,3] => [[0,1,0,0],[0,0,1,0],[0,0,0,1]] 我寫了一個功能做同樣的一個載體: n_val =4 def encoding(x_t): z = T.zeros((x_t.shape[0], n_val)) one_hot = T.set_subtensor(z[T.arange(x

    1熱度

    2回答

    當我嘗試運行我的LSTM時出現以下錯誤程序(用於可變長度輸入)。 TypeError: Inconsistency in the inner graph of scan 'scan_fn' : an input and an output are associated with the same recurrent state and should have the same type but h

    1熱度

    1回答

    我想知道如何用Theano添加兩個向量中的每個元素? 假設我們有兩個矢量vector_1和vecotr_2,並且我們想建立一個矩陣甲,其中 A [i] [j] = vector_1 [我] + vecotr_2 [J] 我知道,在numpy的w^e可以使用列表理解。但我想用Theano以較少的時間獲得結果。看起來Theano.scan()可以完成這項工作,但我真的不知道如何處理它。