Skip to main content
. Author manuscript; available in PMC: 2021 Dec 22.
Published in final edited form as: Phys Med Biol. 2020 Dec 22;65(24):245037. doi: 10.1088/1361-6560/abc812

Algorithm 1.

Generating optimization-based attack.

for i = 1, 2, …, Ntrain do
for k = 1, 2, …, K do
 1. Initialize perturbation p0 randomly; set t = 0;
  while tNiter do
 2. Update pt following equations (3) and (4);
 3. If ptpt12pt12ϵ or t = Niter, set pi*(k)=pt, set t = Niter;
  Otherwise, set t = t + 1, go to step 2;
  end while
end for
end for
Output {pi*(k)i=1,2,,Ntrain,k=1,2,,K}