Giter VIP home page Giter VIP logo

attack-vc's People

Contributors

cyhuang-tw avatar yistlin avatar

Stargazers

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

Watchers

 avatar  avatar

attack-vc's Issues

Issue of generating adversarial samples in the demo

Dear authors,

Thanks for providing the high quality codes and the nice paper. I am trying to generate the adversarial samples in the demo. Since it is not a targeted attack(no y in the demo), I could not use the targeted attack code you provide to generate the adversarial samples directly. Could you please provide the untargeted end-to-end attack code (for equation (1) in the paper )for generating the demo samples?

My attempted modification of the e2e_attack function for untargeted attack is:

def e2e_attack(
model: nn.Module,
vc_src: Tensor,
vc_tgt: Tensor,
adv_tgt: Tensor,
eps: float,
n_iters,
) -> Tensor:
ptb = torch.zeros_like(vc_tgt).normal_(0, 1).requires_grad_(True)
opt = torch.optim.Adam([ptb])
criterion = nn.MSELoss()
pbar = trange(n_iters)

with torch.no_grad():
    org_out = model.inference(vc_src, vc_tgt)
  
losses = []
ptbs=[]

for _ in pbar:
    adv_inp = vc_tgt + ptb
    adv_out = model.inference(vc_src, adv_inp)
    loss =  -  criterion(adv_out, org_out)
    opt.zero_grad()
    loss.backward()
    opt.step()
    ptb.data.clamp_(-eps, eps)

return vc_tgt + ptb

However, the adversarial samples I generate(.e.g epsilon = 0.1 ) is different from yours in the demo.
Any advise or reply will be highly appreciated!

Zihao

how to compute the mean and std of the data

Hi, dear author

I learn a lot from this work, it's a great work.

Currently, Iโ€˜m working on a project, I want to do normalization on my data (mel-spectrogram ) for a better training performance.

I noticed that the std and mean of the data is precomputed, would you mind to tell me how to compute the std and mean of the data.

Thanks.

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.