From bacc2131d95ac78f61b810752c6848cca4993a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E8=AF=8D=E4=BD=A0=E5=A5=BD?= <5434024+kkunshao@user.noreply.gitee.com> Date: Wed, 18 Dec 2024 00:44:49 +0800 Subject: [PATCH] modify some files --- SocialED/utils/graph_deal.py | 43 ------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 SocialED/utils/graph_deal.py diff --git a/SocialED/utils/graph_deal.py b/SocialED/utils/graph_deal.py deleted file mode 100644 index b79067d..0000000 --- a/SocialED/utils/graph_deal.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -"""Outlier Score Converters -""" -# Author: Kay Liu -# License: BSD 2 clause - - -def to_edge_score(score, edge_index): - """Convert outlier node score to outlier edge score by averaging the - scores of two nodes connected by an edge. - - Parameters - ---------- - score : torch.Tensor - The node score. - edge_index : torch.Tensor - The edge index. - - Returns - ------- - score : torch.Tensor - The edge score. - """ - score = (score[edge_index[0]] + score[edge_index[1]]) / 2 - return score - - -def to_graph_score(score): - """Convert outlier node score to outlier graph score by averaging - the scores of all nodes in a graph. - - Parameters - ---------- - score : torch.Tensor - The node score. - - Returns - ------- - score : torch.Tensor - The graph score. - """ - - return score.mean(dim=-1)