Skip to content

Gradient noise defense error #2

@shanefeng123

Description

@shanefeng123

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions