Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rpreen committed Jun 5, 2024
1 parent 59cda82 commit fba1c64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aisdc/attacks/likelihood_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def run_scenario_from_preds( # pylint: disable = too-many-statements, too-many-
target_conf = combined_target_preds[i, label]
target_logit = _logit(target_conf)

# get the behaviour of the record when non-member
# get the probability the target logit is not a non-member
out_scores = np.array(out_confidences[i])
out_mean = 0
out_std = 0
Expand All @@ -393,7 +393,7 @@ def run_scenario_from_preds( # pylint: disable = too-many-statements, too-many-
out_prob = norm.cdf(target_logit, loc=out_mean, scale=out_std + EPS)
mia_scores.append([1 - out_prob, out_prob])
elif self.mode == "online-carlini":

Check warning on line 395 in aisdc/attacks/likelihood_attack.py

View check run for this annotation

Codecov / codecov/patch

aisdc/attacks/likelihood_attack.py#L395

Added line #L395 was not covered by tests
# get the behaviour of the record when member
# get the probability the target logit is not a member
in_scores = np.array(in_confidences[i])
in_mean = 0
in_std = 0
Expand All @@ -407,7 +407,7 @@ def run_scenario_from_preds( # pylint: disable = too-many-statements, too-many-
prob = in_prob - out_prob
mia_scores.append([prob, -prob])
elif self.mode == "offline-carlini":

Check warning on line 409 in aisdc/attacks/likelihood_attack.py

View check run for this annotation

Codecov / codecov/patch

aisdc/attacks/likelihood_attack.py#L407-L409

Added lines #L407 - L409 were not covered by tests
# probability the record is a non-member
# probability the record is not a non-member
prob = out_prob
mia_scores.append([-prob, prob])

Check warning on line 412 in aisdc/attacks/likelihood_attack.py

View check run for this annotation

Codecov / codecov/patch

aisdc/attacks/likelihood_attack.py#L411-L412

Added lines #L411 - L412 were not covered by tests
else:
Expand Down

0 comments on commit fba1c64

Please sign in to comment.