From 70d4e4dfdc024a810e5259d1795c17325ea09f69 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 7 Dec 2024 17:37:19 -0700 Subject: [PATCH] O1: slight cleanup --- one_run_audit/audit.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/one_run_audit/audit.py b/one_run_audit/audit.py index 0a10ee2..19a2bcd 100644 --- a/one_run_audit/audit.py +++ b/one_run_audit/audit.py @@ -596,25 +596,12 @@ def train_convnet(hp, train_dl, test_dl): criterion = nn.CrossEntropyLoss() optimizer = optim.Adam(model.parameters(), lr=1e-3) - - #if hp['epochs'] <= 10: - # optimizer = optim.Adam(model.parameters(), lr=lr) - #elif hp['epochs'] > 10 and hp['epochs'] <= 25: - # optimizer = optim.Adam(model.parameters(), lr=(lr/10)) - #else: - # optimizer = optim.Adam(model.parameters(), lr=(lr/50)) scheduler = MultiStepLR(optimizer, milestones=[10, 25], gamma=0.1) - # scheduler = MultiStepLR( - # optimizer, - # milestones=[int(i * hp['epochs']) for i in [0.3, 0.6, 0.8]], - # gamma=0.2 - # ) - print(f"Training with {hp['epochs']} epochs") if hp['epsilon'] is not None: - privacy_engine = opacus.PrivacyEngine() + privacy_engine = opacus.PrivacyEngine(accountant='rdp') model, optimizer, train_loader = privacy_engine.make_private_with_epsilon( module=model, optimizer=optimizer, @@ -764,7 +751,7 @@ def main(): "wrn_depth": 16, "wrn_width": 1, "epsilon": args.epsilon, - "delta": 1e-5, + "delta": 1e-6, "norm": args.norm, "batch_size": 50 if args.convnet else 4096, "epochs": args.epochs,