Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient noise defense error #2

Open
shanefeng123 opened this issue Nov 19, 2024 · 0 comments
Open

Gradient noise defense error #2

shanefeng123 opened this issue Nov 19, 2024 · 0 comments

Comments

@shanefeng123
Copy link

When I tried to use gradient noise as a defense, I encountered the below NotImplementedError.


Running input #0 of 64.
reference: 
========================
 hurts to be you! Sunshine all weekend and you don`t get to play. That`s sad.
========================
748/24/24
L1 Position 0
Traceback (most recent call last):
  File "/home/xinguo/dager-gradient-inversion/attack.py", line 418, in <module>
    main()
  File "/home/xinguo/dager-gradient-inversion/attack.py", line 353, in main
    prediction, reference = reconstruct(args, device, sample, metric, model_wrapper)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xinguo/dager-gradient-inversion/attack.py", line 114, in reconstruct
    res_pos, res_ids, res_types, sentence_ends = filter_l1(args, model_wrapper, R_Qs)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xinguo/dager-gradient-inversion/attack.py", line 40, in filter_l1
    raise NotImplementedError
NotImplementedError

This is the command I ran.

python attack.py --dataset sst2 --split val --n_inputs 64 --batch_size 1 --l1_filter maxB --l2_filter non-overlap --model_path bert-base-uncased --task seq_class --cache_dir ./models_cache --defense_noise 0.05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant