一:vanilla RNN 使用机器学习技术处理输入为基于时间的序列或者可以转化为基于时间的序列的问题时,我们可以对每个时间步采用递归公式,如下,We can process a sequence of vector x by applying a recurrence formula at every time step: ht = fW( ht-1,xt ) 其中xt 是在第t个时间步的输入(input vector at time step t):ht 是新状态量(new state),
时序预测一直是比较重要的研究问题,在统计学中我们有各种的模型来解决时间序列问题,但是最近几年比较火的深度学习中也有能解决时序预测问题的方法,另外在深度学习领域中时序预测算法可以解决自然语言问题等. 在网上找到了 tensorflow 中 RNN 和 LSTM 算法预测 sin 曲线的代码,效果不错. LSTM: #encoding:UTF-8 import random import numpy as np import tensorflow as tf from
第一步仍然是导入库和数据集. ''' To classify images using a reccurent neural network, we consider every image row as a sequence of pixels. Because MNIST image shape is 28*28px, we will then handle 28 sequences of 28 steps for every sample. ''' 这里我们设定了各种参数,此时的n_ste