Added pseudocode to poster, fixed MNIST results not showing 0 strength

This commit is contained in:
Aidan Sharpe
2024-05-01 11:17:42 -04:00
parent ac1272e123
commit 0ba4e489bb
7 changed files with 843 additions and 54 deletions

Binary file not shown.

21
poster/pseudocode.py Normal file
View File

@ -0,0 +1,21 @@
model = Net()
accuracies = {}
for filter in filters:
for epsilon in epsilons:
for strength in range(5):
correct = 0
total = 0
for data, target in dataset:
atk_data = fgsm_attack(data, epsilon)
filt_data = filter(atk_data, filter, strength)
prediction = model(filt_data)
total += 1
if prediction == target:
correct += 1
accuracies[filter][epsilon][strength] = correct/total
save_json("results.json", accuracies)