From 0f7414bc5ff12b12280df2ee949368ca94743fc9 Mon Sep 17 00:00:00 2001 From: leewlving Date: Thu, 18 Jan 2024 16:57:29 +0800 Subject: [PATCH] add binary --- untargetedAttack.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/untargetedAttack.py b/untargetedAttack.py index 02249e6..a9cfd17 100644 --- a/untargetedAttack.py +++ b/untargetedAttack.py @@ -62,12 +62,9 @@ def main(cfg: DictConfig) -> None: num_epochs = cfg.optim.num_epochs criterion = nn.CrossEntropyLoss() - max_loss=nn.MarginRankingLoss(0.1) clip_loss=CLIPLoss().to(device) loss_fn_vgg = lpips.LPIPS(net='vgg').to(device) - # vgg_loss=VggLoss().to(device) -# summary(model, input_size = (3, 256, 256), batch_size = 5) -# set_requires_grad(model.mlp.parameters()) + optimizer = optim.SGD(model.mlp.parameters()+model.noise_mlp.parameters(), lr=cfg.classifier.lr, momentum=cfg.classifier.momentum) start_time = time.time()