Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions breaching/attacks/optimization_based_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _run_trial(self, rec_model, shared_data, labels, stats, trial, initial_data=
if self.cfg.optim.boxed:
candidate.data = torch.max(torch.min(candidate, (1 - self.dm) / self.ds), -self.dm / self.ds)
if objective_value < minimal_value_so_far:
minimal_value_so_far = objective_value.detach()
minimal_value_so_far = objective_value
best_candidate = candidate.detach().clone()

if iteration + 1 == self.cfg.optim.max_iterations or iteration % self.cfg.optim.callback == 0:
Expand Down Expand Up @@ -184,7 +184,7 @@ def closure():
pass

self.current_task_loss = total_task_loss # Side-effect this because of L-BFGS closure limitations :<
return total_objective
return total_objective.detach()

return closure

Expand Down