台州市城乡建设局网站广州企业网站seo
出处:IJCAI 2024 未开源,链接貌似是:jackyue1994/Sub-Adjacent-Transformer (github.com)
贡献:1. 提出:基于 “次邻域” 及 “注意力贡献” 的注意力学习机制,以增强异常、正常的区分;2. 首次将 “线性注意力” 及 “可学习的映射函数” 引入TSAD。
1. 基本思想
Time points usually have stronger connections with their neighbors and fewer connections with distant points. This characteristic is more pronounced for anomalies [Xu et al., 2022]. →
If we rely solely on subadjacent neighborhoods to reconstruct time points, the reconstruction errors of anomalies will become more pronounced, thereby enhancing their distinguishability.
2. 具体方法
the sub-adjacent neighborhoods (“次邻域” ) 概念:
直观理解:图(b)内的 𝐾2 - 𝐾1 区域;𝐾1、𝐾2 是预定义的区域边界,满足:𝐾2 ≥ 𝐾1 > 0.
具体概念:The sub-adjacent neighborhoods indicate the areas not immediately adjacent to the target point.
𝐾1、𝐾2 是预定义的区域边界,满足:𝐾2 ≥ 𝐾1 > 0. win_size 是划分的时序窗口大小. 红色部分代表 the sub-adjacent neighborhoods.
the sub-adjacent attention (“注意力贡献”) 概念:
1. * 注意力贡献 (attention contribution):在同一窗口内,将注意力矩阵的 “列” 视为:各点对其他点的贡献;
2. 计算:每列各点的 the sub-adjacent attention:
直观理解:图 2 内虚线区域之和.
具体概念:The sub-adjacent attention contribution is defined as the sum of particular non-diagonal elements in the corresponding column of the attention matrix.
3. 计算:整个窗口内,每列各点的 the sub-adjacent attention之和:
4. 实际的细节问题:如果目标点靠近的窗口起点或终点,次邻域范围可能部分超出窗口,因此可用的点数量会变少,造成贡献不均,不平衡:(蓝色阴影部分)
解决方法:
循环移位函数(circular shift function),通过对时间点进行循环移位,确保边界点能够公平地参与注意力贡献计算,即每个点的次邻域内始终有相同数量的时间点:
线性注意力:
损失函数 和 异常分数:
1. 损失函数:在损失函数中,引入“次相邻” 的注意贡献,引导模型关注 “次相邻” 的邻域:
2. 异常分数:
3. Dynamic Gaussian Scoring: