Neural network 使用theano实现LSTM

Neural network 使用theano实现LSTM,neural-network,theano,deep-learning,lstm,Neural Network,Theano,Deep Learning,Lstm,我正在使用无扫描函数来实现LSTM(长-短期内存),但我遇到了如下错误 ValueError: Please provide None as outputs_info for any output that does not feed back into scan (i.e. it behaves like a map) 我以前是这样扫描的 p_c = T.matrix() p_hidden_inputs = T.matrix() out, updates = scan(step_fprop

我正在使用无扫描函数来实现LSTM(长-短期内存),但我遇到了如下错误

ValueError: Please provide None as outputs_info for any output that does not feed back into scan (i.e. it behaves like a map) 
我以前是这样扫描的

p_c = T.matrix()
p_hidden_inputs = T.matrix()
out, updates = scan(step_fprop,
                sequences=model_inputs,
                outputs_info= [p_c, p_hidden_inputs],
                non_sequences=
                [
                Wxi, Whi, Wci, bi,
                Wxf, Whf, Wcf, bf,
                Wxc, Whc, bc,
                Wxo, Who, Wco, bo
                ],
                n_steps=n_steps,
                )
步骤fprop的定义如下:

def step_fprop(inputs, p_c, p_hidden_inputs,
           Wxi, Whi, Wci, bi,
           Wxf, Whf, Wcf, bf,
           Wxc, Whc, bc,
           Wxo, Who, Wco, bo
           ):
"""
Construct the forward propagation
:return:
:rtype:
"""
# input gate
ig = T.nnet.sigmoid(T.dot(inputs, Wxi) +
                    T.dot(p_hidden_inputs, Whi) +
                    T.dot(p_c, Wci) +
                    bi)

# forget gate
fg = T.nnet.sigmoid(T.dot(inputs, Wxf) +
                    T.dot(p_hidden_inputs, Whf) +
                    T.dot(p_c, Wcf) +
                    bf)

# cell
cc= fg * p_c + ig * T.tanh(T.dot(inputs, Wxc) +
                                T.dot(p_hidden_inputs, Whc ) +
                                bc)

#output gate
og = T.nnet.sigmoid(T.dot(inputs, Wxo) +
                    T.dot(p_hidden_inputs,Who)  +
                    T.dot(p_c, Wco) +
                    bo)

#hidden state
hh = og * T.tanh(cc)

return hh

任何人都知道我为什么一直出现这种错误。

输出信息
期望在
步骤fprop
函数的
返回
中传递的每个变量的值。您的代码似乎只返回隐藏状态
hh
,但
outputs\u info
需要两个值,其初始状态由
p\u c
p\u hidden\u输入定义

看起来您需要
在step\u fprop函数中返回[\u whatever\u previous\lstm\u state,hh]