leviswind / pytorch-transformer Goto Github PK
View Code? Open in Web Editor NEWpytorch implementation of Attention is all you need
pytorch implementation of Attention is all you need
1st, backend.Embedding is removed in pytorch.
2nd, the tensors in this repo are not in the same device type, this really messed up the code, I tried to modify this device the tensors in the code stored on, but the more I modify, the more errors it raised, finally I have no choice but giving up read and deploy this code. I suggest you try to define you code purely on cpu, not adding many codes in this repo to clarify than you run some operations on cuda, this really mess this repo up if you didn't make it clear that all the operation is compatible with the storing device type of all the variables.
Traceback (most recent call last):
File "train.py", line 90, in
train()
File "train.py", line 81, in train
writer.export_scalars_to_json(hp.model_dir + '/all_scalars.json')
AttributeError: 'SummaryWriter' object has no attribute 'export_scalars_to_json'
How can i correct it, please?
Thank you for your excellent work,can eval.py infer on one sentence?
I want to know why using the parameter 'sinusoid'? And could I not set the parameter ‘maxlen’ and using varying length of the text between batch?
in if __name__ == '__main__':
outputs = position_encoding(num_units)(inputs)
should be
outputs = positional_encoding(num_units)(inputs)
hi, thanks for your implementation~
When I look up your code and compare with the tf-version by Kyubyong, I fond that the implementation of layer normalization in your repository is slightly differing with Kyubyong's.
followings are you code and K's code, and he added **0.5 in the denominator:
https://github.com/leviswind/pytorch-transformer/blob/master/modules.py#L69
https://github.com/Kyubyong/transformer/blob/master/modules.py#L36
Am I running the train file because of the pytorch version problem?
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.