Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer
概
就是 here 和 TGAT 在推荐系统上的应用. 简单记录一下.
符号说明
- \(\mathcal{U}\), users;
- \(\mathcal{I}\), items;
- \(\mathcal{V} = \mathcal{U} \cup \mathcal{I}\);
- \((u, i, t) \in \mathcal{E}_{\mathcal{T}}\), edges, \(t\) 表示该 interaction 发生的时间;
- \(\mathcal{I}_u(t)\), the set of items interacted with the user \(u\) before timestamp \(t\);
TGSRec
-
首先, 就是正常的 embedding layer:
\[\bm{E} = [\bm{E}_{\mathcal{U}}; \bm{E}_I] \in \mathbb{R}^{d \times |\mathcal{V}|}. \] -
接下来我们希望将 temporal information 注入其中, 通过
\[\Phi(t) \leftarrow \sqrt{\frac{1}{d_T}} [\cos(\omega_1 t), \sin(\omega_1 t), \ldots, \cos (\omega_{d_T}t), \sin(\omega_{d_T}t)]^T. \] -
然后拼接得到:
\[\bm{h}_u(t) = [\bm{e}_u\| \Phi(t)], \]则
\[\bm{h}_u^T(t) \bm{h}_{i}(t') = \bm{e}_u^T \bm{e}_i^T + \Phi(t)^T \Phi(t'), \]后者实际等价于 \(\psi(t - t')\). 故我们实际上利用的是 timespan.
-
后续的过程就比较一般化了.
代码
[official]