jayaram-r / adversarial-detection

Code and experiments for the adversarial detection paper
MIT License
20 stars 3 forks source link

Bugs in adversarial data generation #28

Closed jayaram-r closed 4 years ago

jayaram-r commented 4 years ago
  1. Handle the case where no adversarial samples are generated. This causes error with numpy.vstack.

  2. Filter the rows of data_numpy with mask_valid before calculating the average norm-diff.

  3. Do not skip a batch if there are some valid adversarial samples. Checking num_valid = 0 before skipping a batch.

  4. Filter target_numpy by mask_valid before calculating the label mismatch.

  5. Move the accumulation of adv_examples into total after the accumulation of labels. This ensures that there is no size mismatch between the final arrays total and total_mismatch.

  6. Returning the clean data and labels corresponding to valid adversarial samples, and saving them to numpy files.