From 408f4ef6a8cd034a0e7cba3243c43a7c38ff80b9 Mon Sep 17 00:00:00 2001 From: Mo Zhou Date: Tue, 26 Oct 2021 19:28:17 -0400 Subject: [PATCH] amd/ics: change lambda --- robrank/defenses/amd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robrank/defenses/amd.py b/robrank/defenses/amd.py index fa89908..ee8c82d 100644 --- a/robrank/defenses/amd.py +++ b/robrank/defenses/amd.py @@ -622,7 +622,7 @@ def hm_training_step(model: th.nn.Module, batch, batch_idx, *, if gradual: model._hm_prev_loss = loss.item() if ics: - loss = loss + 1.0 * model.lossfunc.raw( + loss = loss + 0.5 * model.lossfunc.raw( ap_orig[:len(ap_orig)//2], pnemb[:len(pnemb) // 3], ap_orig[len(ap_orig)//2:],