Giter VIP home page Giter VIP logo

dp-forward's People

Contributors

xiangyue9607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dp-forward's Issues

Couldn't find "sst2_eps8_embedding" on hugging face in embedding inversion attack.

In the file attacks/embedding_inversion_attack.py
it uses the following code to load pretrained model on hugging face, but it can't find "sst2_eps8_embedding"

model = BertForSequenceClassification.from_pretrained("bert-base-uncased")
model_dp = BertForSequenceClassification.from_pretrained("sst2_eps8_embedding")
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")

It tells me

OSError: sst2_eps8_embedding is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`

What's more, the example of "embedding_inversion_attack.py" in readme.md is mistaken to be replaced with "sensitive_attributes_attack.py". Could you please give a correct example for embedding inversion attack?

Noise generate

In "add_noise", "torch.normal" is used to generate noise_embeds. Where is "MVG_noise" used?

DP-Forward/dp_noise.py

Lines 162 to 167 in d60f7bd

def add_noise(embeddings,noise_factor=0.5,norm_c=1.0,add_noise=True):
if add_noise:
embeddings = _max_norm_clip(embeddings, norm_c)
noise_embeds = noise_factor * torch.normal(mean=0, std=1, size=embeddings.shape).to(embeddings.device)
embeddings = noise_embeds + embeddings
return embeddings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.