Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeratt committed Dec 5, 2024
1 parent de7a263 commit 5ebdd38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/attacks/CLGA/CLGA_gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ def compute_gradient(self, data):
z1 = self.model(data.x, edge_index_1)
z2 = self.model(data.x, edge_index_2)

# edge_index_1.requires_grad = True
# edge_index_2.requires_grad = True

loss = self.model.loss(z1, z2)
loss.backward()

grad = torch.zeros_like()
# grad = torch.zeros_like()
for name, layer in self.model.encoder.named_children():
if isinstance(layer, MessagePassing):
#print(f"{name}: {layer.get_message_gradients()}")
Expand Down

0 comments on commit 5ebdd38

Please sign in to comment.