循环神经网络代码RNN-超全注释
#inputs t时刻序列,也就是相当于输入
#targets t+1时刻序列,也就是相当于输出
#hprev t-1时刻的隐藏层神经元激活值
def lossFun(inputs, targets, hprev):
xs, hs, ys, ps = {}, {}, {}, {}
hs[-1] = np.copy(hprev)
print('hs=',hs)
loss = 0
#前向传导 inputs 6xn
for t in range(len(inputs)):
2019-12-21 20:17:33
9KB
循环神经网络
1