Skip to content

Commit

Permalink
Merge pull request #92 from pygod-team/kayzliu-patch-1
Browse files Browse the repository at this point in the history
Fix #91: ANOMALOUS device missing
  • Loading branch information
kayzliu authored Nov 29, 2023
2 parents 86b63b6 + a53d8a2 commit 00a60dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pygod/detector/anomalous.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ def decision_function(self, data, label=None):
return self.decision_score_

def process_graph(self, data):
x = data.x
s = data.s
x = data.x.to(self.device)
s = data.s.to(self.device)

s = torch.max(s, s.T)
laplacian = torch.diag(torch.sum(s, dim=1)) - s

w_init = torch.randn_like(x.T)
w_init = torch.randn_like(x.T).to(self.device)
r_init = torch.inverse((1 + self.weight_decay)
* torch.eye(x.shape[0]) + self.gamma * laplacian) @ x
* torch.eye(x.shape[0]).to(self.device) + self.gamma * laplacian) @ x

return x, s, laplacian, w_init, r_init

Expand Down

0 comments on commit 00a60dd

Please sign in to comment.