Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer

Fan Z., Liu Z., Zhang J., Xiong Y., Zheng L. and Yu P. S. Continuous-time sequential recommendation with temporal graph collaborative transformer. CIKM, 2021.

就是 hereTGAT 在推荐系统上的应用. 简单记录一下.

符号说明

  • \(\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]

posted @ 2023-09-05 10:57  馒头and花卷  阅读(21)  评论(0编辑  收藏  举报