zhengliz / natural-adversary Goto Github PK
View Code? Open in Web Editor NEWGenerating Natural Adversarial Examples, ICLR 2018
License: Other
Generating Natural Adversarial Examples, ICLR 2018
License: Other
I found kenlm in the text code, but kenlm training will not be excuted with default parameters setting. Is kenlm training necessary for the generating fluent text?
Hi, thank you for sharing the code. I read your paper and I am trying to train and modify.
I have a question about how you optimize the encoder.
You are optimizing the encoder and the critic from the same loss at train_gan_d
, but is this collect?
In my understanding, the encoder's loss function and the critic loss function are different.
Hello there,
First, thanks for sharing your code!
I'm trying to run train_baseline
for text but I'm getting this error:
Traceback (most recent call last):
File "train_baseline.py", line 66, in <module>
corpus_train = SNLIDataset(train=True, vocab_size=11004, lvt=False, path=args.data_path)
File "/home/aosman/02_fields/adversarial/natural-adversary/text/utils.py", line 276, in __init__
self.train_data = self.tokenize(self.train_path)
File "/home/aosman/02_fields/adversarial/natural-adversary/text/utils.py", line 336, in tokenize
label = self.labels[tokens[0]]
KeyError: 'A person on a horse jumps over a broken down airplane .'
it seems that the labels are missing from the text files (train.txt
and test.txt
). Would you be kind to provide them or let me know where to get them?
Thanks!
Hi zhengliz,
Thanks for sharing code.
just followed README.
i was trying see demo results. but couldn't get it as it's throwing issue.
$ python generate.py --load_path ./output/1535710044
{'ninterpolations': 5, 'temp': 1, 'load_path': './output/1535710044', 'sample': False, 'seed': 1111, 'steps': 5, 'noprint': False, 'outf': './generated.txt', 'ngenerations': 10}
Loading models from./output/1535710044/models
Traceback (most recent call last):
File "generate.py", line 135, in <module>
main(args)
File "generate.py", line 74, in main
maxlen=model_args['maxlen'])
File "/natural-adversary/text/models.py", line 654, in generate
sample=sample)
File "/natural-adversary/text/models.py", line 303, in generate
embedding = self.embedding_decoder(self.start_symbols)
File "/venv/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in __call__
result = self.forward(*input, **kwargs)
File "/venv/local/lib/python2.7/site-packages/torch/nn/modules/sparse.py", line 103, in forward
self.scale_grad_by_freq, self.sparse
File "/venv/local/lib/python2.7/site-packages/torch/nn/_functions/thnn/sparse.py", line 59, in forward
output = torch.index_select(weight, 0, indices.view(-1))
TypeError: torch.index_select received an invalid combination of arguments - got (torch.cuda.FloatTensor, int, torch.LongTensor), but expected (torch.cuda.FloatTensor source, int dim, torch.cuda.LongTensor index)
could you please tell me why is this issue coming ?
thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.