Skip to content

Commit

Permalink
Fix #91: ANOMALOUS device missing
Browse files Browse the repository at this point in the history
  • Loading branch information
kayzliu committed Nov 29, 2023
1 parent 86b63b6 commit a53d8a2
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 a53d8a2

Please sign in to comment.