Skip to content

Commit

Permalink
Changed target epsilon to desired 7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
advaithsrao committed Dec 5, 2023
1 parent cd992aa commit 9bd7cad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ethics/differential_privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,15 @@ def train(
scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=0, num_training_steps=total_steps)

MAX_GRAD_NORM = 0.1
TARGET_EPSILON = 7.5
TARGET_DELTA = 1/total_steps

self.model, optimizer, _ = self.privacy_engine.make_private_with_epsilon(
module=self.model,
optimizer=optimizer,
data_loader=train_dataloader,
target_delta=1/total_steps,
target_epsilon=self.epsilon,
target_delta=TARGET_DELTA,
target_epsilon=TARGET_EPSILON,
epochs=self.num_epochs,
max_grad_norm=MAX_GRAD_NORM,
)
Expand Down

0 comments on commit 9bd7cad

Please sign in to comment.