From 9bd7cad21b03a056e28c31dcbd4229c8ea36b41b Mon Sep 17 00:00:00 2001 From: Advaith Rao Date: Mon, 4 Dec 2023 19:02:12 -0500 Subject: [PATCH] Changed target epsilon to desired 7.5 --- ethics/differential_privacy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethics/differential_privacy.py b/ethics/differential_privacy.py index dadd931..d21e140 100644 --- a/ethics/differential_privacy.py +++ b/ethics/differential_privacy.py @@ -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, )