Comments (1)
Yes, the split decoder mechanism is implemented, however, I found a mistake that is causing the error. The error is due to copier_out
being a list of Tensor, instead of a Tensor. As you can see here, TransformerDecoder returns a list of representations where each item is the output from each layer of the TransformerDecoder. So, to make the split decoder mechanism work, you need to make 2 changes.
First, in the following line,
f_t = self.fusion_sigmoid(torch.cat([copier_out, dec_out], dim=-1))
copier_out
and dec_out
are both lists. So, modify the line as follows.
f_t = self.fusion_sigmoid(torch.cat([copier_out[-1], dec_out[-1]], dim=-1))
Second,
When split decoder mechanism is enabled, decoder_outputs
[as in here] is no longer a list of Tensor, it is only a Tensor. Therefore, to cope with the statements 1 and 2, you can simply do:
decoder_outputs = self.fusion_gate(gate_input)
decoder_outputs = [decoder_outputs]
Hopefully, this would work but please verify it. A pull request is welcomed.
from neuralcodesum.
Related Issues (20)
- Problem about the symbol in python data. HOT 2
- Getting the embedding for the sample code HOT 3
- code.original_subtoken file not found HOT 1
- ??md
- Extract the attention weights HOT 3
- Potential Bug iterator Pytorch HOT 1
- RuntimeError: "index_select_out_cuda_impl" not implemented for 'Float While comment generation testing the code HOT 3
- Model is not learning problem HOT 4
- No such file: ../../data/java/test/code.original_subtoken while training a model HOT 3
- Questions about javadoc generation HOT 1
- how to train a model without copy attention? HOT 1
- problem while trying to test the code HOT 2
- Do you have a trained model? HOT 1
- Question about dataset HOT 2
- Project dependencies may have API risk issues
- Model is not learning and is not generating meaningful output HOT 1
- Number of generated samples does not HOT 1
- Couldn't testing after training, error information just like this.... HOT 1
- Question regarding qualitative example from your paper.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuralcodesum.