循环神经网络

1 RNN的统计学基础

1.1 回归:

Investpedia:
Regression refers to the relation between selected values of x and observed values of y (from which the most probable value of y can be predicted for any value of x). The general form of each type of regression is:

  • Simple linear regression: Y=a+bX+uY = a + bX + u
  • Multiple linear regression: Y=a+b1X1+b2X2+b3X3+...+btXt+uY = a + b_1X_1 + b_2X_2 + b_3X_3 + ... + b_tX_t + u
    Where:
    YY = the variable that you are trying to predict (dependent variable,因变量).
    XX = the variable that you are using to predict Y (independent variable,自变量).
    aa = the intercept(截距).
    bb = the slope(斜率).
    uu = the regression residual(回归残差).

1.2 自回归(Auto-Regression, AR模型)

自回归,即AR模型,属于时间序列分析的范畴,即用一个变量yty_t的历史信息来预测自己,tutorialspoint给出的定义:

  • For a stationary time series, an auto regression models sees the value of a variable at time ‘t’ as a linear function of values ‘p’ time steps preceding it. Mathematically it can be written as:
    yt=C+ϕ1yt1+ϕ2yt2+...+ϕpytp+ϵty_t=C+ϕ_1y_{t−1}+ϕ_2y_{t−2}+...+ϕ_py_{t−p}+ϵ_t
    Where,‘p’ is the auto-regressive trend parameter
    ϵtϵ_t is white noise, and yt1,yt2...ytpy_{t−1},y_{t−2}...y_{t−p} denote the value of variable at previous time periods.

1.3 有外部输入的非线性自回归模型(Nonlinear AutoRegressive with Exogenous Inputs Model,NARX)

NARX是自回归模型的扩展,在每个时刻tt都有一个外部输入xtx_t,产生一个输出yty_t,NARX通过一个延时器记录最近KxK_x次的外部输入和最近KyK_y次的输出,第tt个时刻的输出yty_t为:
yt=f(xt,xt1,...,xtKx,yt1,yt2,...,ytKy)y_t=f(x_t,x_{t-1},...,x_{t-K_x},y_{t-1},y_{t-2},...,y_{t-K_y})
其中f()f()表示非线性函数,可以是一个前馈网络,KxK_xKyK_y为超参数。

2 简单循环神经网络

2.1 循环神经网络的通用近似定理

如果一个完全连接的循环神经网络有足够数量的 sigmoid 型隐藏神经元,它可以以任意的准确率去近似任何一个非线性动力系统:


st=g(st1,xt)s_t = g(s_{t-1}, x_{t})
yt=o(st)y_t = o(s_t)

2.2 学习模式

2.3 参数学习

2.4 梯度爆炸、梯度消失与长程依赖问题

2.5 门控机制、LSTM及其变体

2.6 深层循环神经网络

2.6.1 堆叠循环神经网络

循环神经网络
图 按时间展开的堆叠循环神经网络

2.6.2 双向循环神经网络

在有些任务中,一个时刻的输出不但和过去时刻的信息有关,也和后续时刻
的信息有关.比如给定一个句子,其中一个词的词性由它的上下文决定,即包含左右两边的信息.因此,在这些任务中,我们可以增加一个按照时间的逆序来传递信息的网络层,来增强网络的能力.
双向循环神经网络(Bidirectional Recurrent Neural Network,Bi-RNN)由
两层循环神经网络组成,它们的输入相同,只是信息传递的方向不同.循环神经网络
图 按时间展开的双向循环神经网络