首页 > 其他分享 >Self-Supervised Hypergraph Convolutional Networks for Session-based Recommendation

Self-Supervised Hypergraph Convolutional Networks for Session-based Recommendation

时间:2023-06-02 13:22:22浏览次数:58  
标签:Convolutional mathbb mathbf Self times theta Theta Hypergraph hat

目录

Xia X., Yin H., Yu J., Wang Q., Cui L and Zhang X. Self-supervised hypergraph convolutional networks for session-based recommendation. AAAI, 2021.

自监督加(超)图用于 session 推荐.
COTREC 简直就是双胞胎, 还是同一年发的, 还能这么玩啊.

符号说明

  • \(I = \{i_1, i_2, i_3, \ldots, i_N\}\), items;
  • \(s = [i_{s,1}, i_{s, 2}, i_{s, 3}, \ldots, i_{s, m}]\), 某个 session 序列;
  • \(\mathbf{X}^{(l)} \in \mathbb{R}^{N \times d^{(l)}}\) 表示神经网络第 \(l\) 层的 embeddings, \(\mathbf{X}^{(0)}\) 为初始的 embeddings;

Hypergraph

  • 超图 \(G = (V, E)\), 其中 \(E\) 包含 \(M\) 条 hyperedges, 每条 hyperedge \(\epsilon \in E\) 可以包含多个结点, 其上的权重为 \(W_{\epsilon\epsilon}\). 由此可以得到对角矩阵:

    \[\mathbf{W} \in \mathbb{R}^{M \times M}. \]

  • 超图可以用 incidence matrix \(\mathbf{H} \in \mathbb{R}^{N \times M}\) 来表示, 其中 \(H_{i\epsilon} = 1\) 若 \(v_i \in \epsilon\).

  • 由此, 我们可以构建 degree matrix:

    \[\mathbf{D} = \text{diag}(\mathbf{HW}\mathbf{1}) \in \mathbb{R}^{N \times N}, \quad \mathbf{B} = \text{diag}(\mathbf{1}^T\mathbf{H}) \in \mathbb{R}^{M \times M}. \]

Line graph

  • 对于超图 \(G = (V, E)\), 定义它的 line graph 为 \(L(G) = (V_L, E_L)\), 其中的每个结点都是一条 hyperedge \(\epsilon\), 即 \(V_L = E\), 而:

    \[E_L = \{(v_{e_p}, V_{e_q}): e_p, e_q \in E, |e_p \cap e_q| \ge 1\}. \]

  • 文中对 \(E_L\) 中的每条边分配权重:

    \[W_{p, q} = |e_p \cap e_q| / |e_p \cup e_q|. \]

DHCN

Hypergraph Channel

  • 这一步, 我们利用超图进行信息的传播:

    \[\mathbf{X}_h^{(l+1)} = \underbrace{(\mathbf{D}^{-1}}_{E \rightarrow V} \mathbf{HW}) \underbrace{(\mathbf{B}^{-1} \mathbf{H}^T)}_{V \rightarrow E} \mathbf{X}_h^{(l)}, \]

    这一步完成了 \(V \rightarrow E \rightarrow V\) 的信息聚合, 其中并没有可训练的参数.

  • 接着, 融合各层的特征:

    \[\mathbf{X}_h = \frac{1}{L+1} \sum_{l=0}^L \mathbf{X}_h^{(l)}. \]

  • 注入位置信息:

    \[\mathbf{x}_t^* = \tanh(\mathbf{W}_1[\mathbf{x}_t \| \mathbf{p}_{m-i+1}] + \mathbf{b}), \]

    其中 \(\mathbf{W}_1 \in \mathbb{R}^{d \times 2d}, b \in \mathbb{R}^d\) 为可训练的参数,

    \[\mathbf{P}_r = [\mathbf{p}_1, \mathbf{p}_2, \mathbf{p}_3, \ldots, \mathbf{p}_m]. \]

  • 通过 soft attention 进行融合:

    \[\theta_h = \sum_{t=1}^m \alpha_t \mathbf{x}_t, \\ \alpha_t = \mathbf{f}^T \sigma(\mathbf{W}_2 \mathbf{x}_s^* + \mathbf{W}_3 \mathbf{x}_t^* + \mathbf{c}), \\ \mathbf{x}_s^* = \frac{1}{m} \sum_{t=1}^m \mathbf{x}_m. \]

  • 这一部分作为主要的 encoder, 用于推荐, 在训练中负责主要的推荐损失:

    \[\mathcal{L}_r = -\sum_{i=1}^N \mathbf{y}_i \log (\mathbf{\hat{y}}_i) + (1 - \mathbf{y}_i) \log (1 - \mathbf{\hat{y}}_i), \\ \mathbf{\hat{y}} = \text{softmax}(\mathbf{\hat{z}}), \\ \mathbf{\hat{z}}_i = \theta_h^T \mathbf{x}_i. \\ \]

Line Graph Channel

  • 令 \(L(G)\) 的邻接矩阵表示为 \(\mathbf{A} = \in \mathbb{R}^{M \times M}, A_{p,q} = W_{p, q}\). \(\mathbf{\hat{A}} = \mathbf{A + I}\), \(\mathbf{\hat{D}}\) 为其 degree matrix, 则

    \[\Theta_l^{(l+1)} = \mathbf{\hat{D}}^{-1} \mathbf{\hat{A}} \Theta^{(l)} \]

    其中 \(\Theta^{(0)}\) 为 session 中 item embeddings 的平均.

  • 接着, 采取 average 的方式进行融合:

    \[\Theta_l = \frac{1}{L + 1} \sum_{l=0}^L \Theta_l^{(l)}. \]

Contrastive Learning

  • 我们视作 \((\theta_i^h, \theta_i^l)\) 为 postive pair, 而 \((\tilde{\theta}_i^h, \theta_i^l)\) 为 negative pair, 其中 \(\tilde{\theta}_i^h\) 是在 \(\Theta_h\) 进行 row-wise 和 col-wise shuffling 后得到的负样本.

  • 接着, 我们用如下损失来鼓励 positive pair 接近, 而 negative pair 互相远离:

    \[\mathcal{L}_s = -\log \sigma(f_D (\theta_i^h, \theta_i^l)) - \log \sigma(1 - f_D(\tilde{\theta}_i^h, \theta_i^l)). \]

    这里, 我们用内积建模判别器 \(f_D\).

优化

  • 最后的损失即为

    \[\mathcal{L} = \mathcal{L}_r + \beta \mathcal{L}_s. \]

代码

official

标签:Convolutional,mathbb,mathbf,Self,times,theta,Theta,Hypergraph,hat
From: https://www.cnblogs.com/MTandHJ/p/17451523.html

相关文章

  • 使用WPF、OwinSelfHost和Swagger创建自托管的Web API
    在本篇博客中,我将介绍如何在WPF应用程序中使用OwinSelfHost和Swagger来创建自托管的WebAPI。我们将使用WPF作为我们的应用程序界面,OwinSelfHost来自托管我们的WebAPI,并使用Swagger来为我们的API生成文档。首先,确保你的计算机上已安装了以下组件:VisualStudio2017.NETFramew......
  • Self-Supervised Graph Co-Training for Session-based Recommendation
    目录概符号说明COTREC图的构建ItemViewEncodingSessionViewEncodingCo-TrainingContrastiveLearningDivergenceConstraint优化代码XiaX.,YinH.,YuJ.,ShaoY.andCuiL.Self-supervisedgraphco-trainingforsession-basedrecommendation.CIKM,2021.概自监......
  • QA|外部调用类方法总报错missing 1 required positional argument:'self'|UI自动化
    外部调用类方法总报错missing1requiredpositionalargument:'self' 原因:实例化这个类实例化错了,少了括号()解决:改成如下就可以了 参考学习:调用类方法时报错:missing1requiredpositionalargument:'self'-hehehe_wy7-博客园(cnblogs.com) ......
  • 论文阅读 | Learn from Others and Be Yourself in Heterogeneous Federated Learning
    在异构联邦学习中博采众长做自己代码:https://paperswithcode.com/paper/learn-from-others-and-be-yourself-in摘要联邦学习中有异质性问题和灾难性遗忘。首先,由于非I.I.D(相同独立分布)数据和异构体系结构,模型在其他领域的性能下降,并且与参与者模型之间存在通信障碍。其次,在局......
  • leetcode 728. Self Dividing Numbers
    Aself-dividingnumberisanumberthatisdivisiblebyeverydigititcontains.Forexample,128isaself-dividingnumberbecause128%1==0,128%2==0,and128%8==0.Also,aself-dividingnumberisnotallowedtocontainthedigitzero.Givenal......
  • Self-consistency Improves Chain of Thought Reasoning in Language Models 论文阅读
    ICLR2023原文地址1.MotivationChain-of-Thought(CoT)使LargeLanguageModels(LLMs)在复杂的推理任务中取得了令人鼓舞的结果。本文提出了一种新的解码策略——self-consistency,以取代贪婪解码。self-consistency利用了一种直觉,即一个复杂的推理问题通常允许多种不同的思维......
  • 创建一个自托管(Self-Host)的WCF Service
    创建一个自托管(Self-Host)的WCFService//CreateWCFservicehostUribaseAddress=newUri("https://127.0.0.1:8087/MyWcfService");ServiceHosthost=newServiceHost(typeof(MyWcfService));host.Credentials.ServiceCertificate.SetCertificate(StoreL......
  • iOS8 Self Sizing UITableView Cells iOS8Tableview Cells 自适应高度
    UITableViewUITableViewTheoldwayUITableView inheritsfrom UIScrollView).Iftherowswere allequalthiswas justasimpleoperation.Butiftheywere different,ithad toknow theheightsofalltherowsandsumthem.Itaskedusfortheheightofeve......
  • CLIP-S^4:Language-Guided Self-Supervised Semantic Segmentation论文阅读笔记
    摘要作者提出了CLIP-S4,借助自监督像素表示学习和V-L模型实现各种语义分割任务,不需要使用任何像素级别标注以及未知类的信息。作者首先通过对图像的不同增强视角进行像素-分割对比学习来学习像素嵌入。之后,为进一步改善像素嵌入并实现基于自然语言的语义分割,作者设计了由V-L模型指......
  • python类中调用类方法时,报错self参数未填
    转载:(14条消息)python类中调用类方法时,报错self参数未填。_追天一方的博客-CSDN博客又碰到了一个小错误比如一个类如下:classprint_number(object):def__init__(self,string="数字是"):self.string=stringdefprint_(self,ss=3):print("{}:{}".......