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:
- Multiple linear regression:
Where:
= the variable that you are trying to predict (dependent variable,因變量).
= the variable that you are using to predict Y (independent variable,自變量).
= the intercept(截距).
= the slope(斜率).
= the regression residual(迴歸殘差).
1.2 自迴歸(Auto-Regression, AR模型)
自迴歸,即AR模型,屬於時間序列分析的範疇,即用一個變量的歷史信息來預測自己,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:
Where,‘p’ is the auto-regressive trend parameter
is white noise, and denote the value of variable at previous time periods.
1.3 有外部輸入的非線性自迴歸模型(Nonlinear AutoRegressive with Exogenous Inputs Model,NARX)
NARX是自迴歸模型的擴展,在每個時刻都有一個外部輸入,產生一個輸出,NARX通過一個延時器記錄最近次的外部輸入和最近次的輸出,第個時刻的輸出爲:
其中表示非線性函數,可以是一個前饋網絡, 和爲超參數。
2 簡單循環神經網絡
2.1 循環神經網絡的通用近似定理
如果一個完全連接的循環神經網絡有足夠數量的 sigmoid 型隱藏神經元,它可以以任意的準確率去近似任何一個非線性動力系統:
2.2 學習模式
2.3 參數學習
2.4 梯度爆炸、梯度消失與長程依賴問題
2.5 門控機制、LSTM及其變體
2.6 深層循環神經網絡
2.6.1 堆疊循環神經網絡
圖 按時間展開的堆疊循環神經網絡
2.6.2 雙向循環神經網絡
在有些任務中,一個時刻的輸出不但和過去時刻的信息有關,也和後續時刻
的信息有關.比如給定一個句子,其中一個詞的詞性由它的上下文決定,即包含左右兩邊的信息.因此,在這些任務中,我們可以增加一個按照時間的逆序來傳遞信息的網絡層,來增強網絡的能力.
雙向循環神經網絡(Bidirectional Recurrent Neural Network,Bi-RNN)由
兩層循環神經網絡組成,它們的輸入相同,只是信息傳遞的方向不同.
圖 按時間展開的雙向循環神經網絡