1. 程式人生 > 其它 >DeepFM: A Factorization-Machine based Neural Network for CTR Prediction

DeepFM: A Factorization-Machine based Neural Network for CTR Prediction

目錄

Guo H., Tang R., Ye Y., Li Z. and He X. DeepFM: a factorization-machine based neural network for CTR prediction. In International Joint Conference on Artificial Intelligence (IJCAI), 2017.

作者認為特徵的low-order交叉和high-order交叉對於預測都是同等重要的, 但是之前的工作要麼偏向low-order, 要麼偏向high-order, 要麼依賴特徵工程. 本文就提出一種能夠自動學習的DeepFM.

主要內容

資料

假設資料形為 \((x, y)\), 其中 \(x\) 包含 \(m\)-fields:

\[x = [x_{field_1}, x_{field_2}, \cdots, x_{field_m}]. \]

每一個field就是某一種特徵屬性, 對於類別型的field, \(x_{field}\)是 one-hot 向量 (如性別等屬性), 而對於連續型的 field \(x_{field}\)就是值本身 (比如年齡等屬性). 通常 \(x\) 是一個非常稀疏的向量.

標籤 \(y \in \{0, 1\}\) 則表示該 item 是否被點選了.

FM 部分

FM 部分實際上就是:

  1. Addition 模組:
\[\langle w, x \rangle = \sum_{i} w_i x_i. \]
  1. 交叉模組 (內積):
\[\sum_{i=1}\sum_{j = i + 1} \langle V_i, V_j \rangle x_i \cdot x_j, \]

其中 \(V_i \in \mathbb{R}^k\)\(x_i\) 所對應的 embedding.

  1. 最後
\[y_{FM} = \langle w, x \rangle = \sum_{i} w_i x_i + \sum_{i=1}\sum_{j = i + 1} \langle V_i, V_j \rangle x_i \cdot x_j. \]

問: 為什麼不 field-aware ?

Deep 部分

  1. 通過 embedding layer 為每個 field 提取 embedding \(e\), 最後得到:
\[a^{(0)} = [e_1, e_2, \cdots, e_m]. \]
  1. 通過 MLP 獲得 high-order 的資訊:
\[a^{(l+1)} = \sigma (W^{(l)}a^{(l)} + b^{(l)}), \\ y_{DNN} = a^{(H + 1)}. \]

這裡 \(\sigma(\cdot)\) 僅僅代表啟用函式.

Joint

最後通過

\[\hat{y} = sigmoid(y_{FM} + y_{DNN}) \]

進行預測.

其它細節

  1. FM, Deep 部分共享 \(V\);
  2. dropout: 0.5;
  3. MLP: 400-400-400;
  4. optimizer: Adam;
  5. Actication: ReLU

程式碼

[official]
[PyTorch]
[TensorFlow]