当我使用 Keras 运行此代码时:
networkDrive = Input(batch_shape=(1,length,1))
network = SimpleRNN(3, activation='tanh', stateful=False, return_sequences=True)(networkDrive)
generatorNetwork = Model(networkDrive, network)
predictions = generatorNetwork.predict(noInput, batch_size=length)
print(np.array(generatorNetwork.layers[1].get_weights()))
我得到这个输出
[array([[ 0.91814435, 0.2490257 , 1.09242284]], dtype=float32)
array([[-0.42028981, 0.68996912, -0.58932084],
[-0.88647962, -0.17359462, 0.42897415],
[ 0.19367599, 0.70271438, 0.68460363]], dtype=float32)
array([ 0., 0., 0.], dtype=float32)]
我想,(3,3) 矩阵是权重矩阵,将 RNN 单元相互连接起来,两个数组之一可能是偏差但是第三个是什么?