File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 16
16
def labelFlipping (
17
17
dataset ,
18
18
indices ,
19
- poisoned_persent = 0 ,
19
+ poisoned_percent = 0 ,
20
20
targeted = False ,
21
21
target_label = 4 ,
22
22
target_changed_label = 7 ,
@@ -56,9 +56,9 @@ def labelFlipping(
56
56
# classes = new_dataset.classes
57
57
# class_to_idx = new_dataset.class_to_idx
58
58
# class_list = [class_to_idx[i] for i in classes]
59
- class_list = set (targets .tolist ())
59
+ class_list = list ( set (targets .tolist () ))
60
60
if not targeted :
61
- num_flipped = int (poisoned_persent * num_indices )
61
+ num_flipped = int (poisoned_percent * num_indices )
62
62
if num_indices == 0 :
63
63
return new_dataset
64
64
if num_flipped > num_indices :
Original file line number Diff line number Diff line change @@ -2507,10 +2507,10 @@ <h5 class="step-title">Schema of deployment</h5>
2507
2507
document . getElementById ( "poisoned-node-title" ) . style . display = "block" ;
2508
2508
document . getElementById ( "poisoned-node-percent-container" ) . style . display = "block" ;
2509
2509
document . getElementById ( "poisoned-sample-percent" ) . value = 0 ;
2510
- document . getElementById ( "poisoned-sample-title" ) . style . display = "none " ;
2511
- document . getElementById ( "poisoned-sample-percent-container" ) . style . display = "none " ;
2512
- document . getElementById ( "poisoned-noise-title" ) . style . display = "block " ;
2513
- document . getElementById ( "poisoned-noise-percent-container" ) . style . display = "block " ;
2510
+ document . getElementById ( "poisoned-sample-title" ) . style . display = "block " ;
2511
+ document . getElementById ( "poisoned-sample-percent-container" ) . style . display = "block " ;
2512
+ document . getElementById ( "poisoned-noise-title" ) . style . display = "none " ;
2513
+ document . getElementById ( "poisoned-noise-percent-container" ) . style . display = "none " ;
2514
2514
}
2515
2515
else if ( this . value == "GLLNeuronInversionAttack" || this . value == "NoiseInjectionAttack" || this . value == "SwappingWeightsAttack" || this . value == "DelayerAttack" ) {
2516
2516
document . getElementById ( "poisoned-node-title" ) . style . display = "block" ;
You can’t perform that action at this time.
0 commit comments