Spaces:
Build error
Build error
Commit
·
63bdcb1
1
Parent(s):
b273a7b
Update pages/3_Adversarial_attack.py
Browse files
pages/3_Adversarial_attack.py
CHANGED
|
@@ -118,7 +118,7 @@ if pred_class_id == (input_id-1) and (epsilon_button or find_epsilon or setting_
|
|
| 118 |
perturbed_data, new_prob, new_id, new_label = perform_attack(input_image, input_id-1, epsilon)
|
| 119 |
else:
|
| 120 |
epsilons = [i*step_epsilon for i in range(1, 1001) if i*step_epsilon <= max_epsilon]
|
| 121 |
-
with epsilon_container:
|
| 122 |
epsilon_container_text = 'Checking epsilon'
|
| 123 |
st.write(epsilon_container_text)
|
| 124 |
st.progress(0)
|
|
@@ -126,7 +126,7 @@ if pred_class_id == (input_id-1) and (epsilon_button or find_epsilon or setting_
|
|
| 126 |
for i, e in enumerate(epsilons):
|
| 127 |
|
| 128 |
perturbed_data, new_prob, new_id, new_label = perform_attack(input_image, input_id-1, e)
|
| 129 |
-
with epsilon_container:
|
| 130 |
epsilon_container_text = f'Checking epsilon={e:.3f}. Confidence={new_prob*100:.1f}%'
|
| 131 |
st.write(epsilon_container_text)
|
| 132 |
st.progress(i/len(epsilons))
|
|
|
|
| 118 |
perturbed_data, new_prob, new_id, new_label = perform_attack(input_image, input_id-1, epsilon)
|
| 119 |
else:
|
| 120 |
epsilons = [i*step_epsilon for i in range(1, 1001) if i*step_epsilon <= max_epsilon]
|
| 121 |
+
with epsilon_container.container():
|
| 122 |
epsilon_container_text = 'Checking epsilon'
|
| 123 |
st.write(epsilon_container_text)
|
| 124 |
st.progress(0)
|
|
|
|
| 126 |
for i, e in enumerate(epsilons):
|
| 127 |
|
| 128 |
perturbed_data, new_prob, new_id, new_label = perform_attack(input_image, input_id-1, e)
|
| 129 |
+
with epsilon_container.container():
|
| 130 |
epsilon_container_text = f'Checking epsilon={e:.3f}. Confidence={new_prob*100:.1f}%'
|
| 131 |
st.write(epsilon_container_text)
|
| 132 |
st.progress(i/len(epsilons))
|