Skip to content

Commit

Permalink
Update norm_attack.py
Browse files Browse the repository at this point in the history
remove sigmoid in norm attack
  • Loading branch information
Jerseyshin authored Jun 26, 2024
1 parent 27f9f78 commit 24a7e54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fedlearner/privacy/splitnn/norm_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def get_norm_pred(loss, var_list, gate_gradients, marvell_protection, sumkl_thre
if marvell_protection:
g = KL_gradient_perturb(g, y, float(sumkl_threshold))
# 计算gradient二范数,label=0和label=1的gradient二范数会存在差异
norm_pred = tf.math.sigmoid(tf.norm(g, ord=2, axis=1))
norm_pred = tf.norm(g, ord=2, axis=1)
return norm_pred

def norm_attack_auc(loss, var_list, gate_gradients, y, marvell_protection, sumkl_threshold):
Expand Down

0 comments on commit 24a7e54

Please sign in to comment.