cleaned up for submission
This commit is contained in:
@@ -32,7 +32,7 @@ class UnlearningAttack:
|
||||
if model1.__class__.__name__ == "WF_Module":
|
||||
gate = torch.full((data.size(0),), target_class, device=device)
|
||||
p1 = torch.softmax(model1(data, target_class_indices=gate), dim=1)
|
||||
|
||||
|
||||
else: # its a normal nn.Module
|
||||
p1 = torch.softmax(model1(data), dim=1)
|
||||
p2 = torch.softmax(model2(data), dim=1)
|
||||
@@ -43,12 +43,14 @@ class UnlearningAttack:
|
||||
|
||||
|
||||
def calculate_a_dist(self, latent1, latent2):
|
||||
|
||||
|
||||
accuracy_score = self._comput_adversarial_accuracy(latent1, latent2, axis=0)
|
||||
epsilon = 1 - accuracy_score
|
||||
|
||||
return 2.0 * np.abs(0.5 - epsilon)
|
||||
|
||||
|
||||
|
||||
def _extract_attack_features(self, target_model, loader, device, target_class):
|
||||
|
||||
target_model.eval()
|
||||
|
||||
@@ -299,16 +299,6 @@ execution_time_sec
|
||||
0.001947
|
||||
0.001871
|
||||
0.003117
|
||||
16.738618
|
||||
0.001900
|
||||
0.002124
|
||||
0.001867
|
||||
0.001870
|
||||
0.002135
|
||||
0.001923
|
||||
0.001955
|
||||
0.001853
|
||||
0.002758
|
||||
16.945078
|
||||
0.001848
|
||||
0.001868
|
||||
|
||||
Reference in New Issue
Block a user