Comments (5)
hi @NickShahML
we use highway connections (Eq.7) instead of identity connections (residual).
this is implemented in the CUDA code.
comparing highway with identity (or the version w/o any skip connections) is a TODO.
I would love to hear feedback from you as well :). thanks!
from sru.
similar question #9
from sru.
Gotcha @taolei87 . I'll need to modify the cuda code to do the residual adding as I suggested above. Right now I don't have the time, but I can't imagine it being too difficult. In my experience, residual connections always perform better than highway connections for RNNs and are much cheaper.
from sru.
@NickShahML I tried a bit residual in ICML language modeling task. The training loss decreases much slower compared to using highway. so I stopped given time & resource constraints.
Of course I might not be doing this very carefully or thoroughly. would love to hear your feedback. thanks!
from sru.
@taolei87 Thanks for the update. Unfortunate that you're getting this result. I looked at your commits and I couldn't find where you implemented this change. DO you mind pushing the code so that I can check your implementation?
Basically, each subsequent layer should have an element-wise addition from the past layer's input.
Another avenue that I think could be extremely powerful is to do self attention at each layer. It would be best to do multiplicative attention with 8 heads as they do in this paper:
https://arxiv.org/abs/1706.03762
The idea is this:
output = SRUCell_Zero(input)
output += self_attention(output)/tf.sqrt(num_nuerons) #8 heads concatenated. These are then added element wise to the output
output += SRUCell_One(output)
# Repeat attention and cell depending on how many layers you want.
The idea here is we can attend to multiple parts of the input in parallel which is computational very fast. One thing we would need to specify is to whether we mask future inputs to attend to. If you're doing a language modeling task for example, the network can just memorize the future inputs with this attention mechanism. However, if you're doing a classification task, then masking is not needed at all since the sequence is already generated.
from sru.
Related Issues (20)
- nan in SRU output HOT 10
- batch_first flag HOT 1
- "Just-in-time loading and compiling the CUDA kernels of SRU was unsuccessul" HOT 2
- Nan in output from example code HOT 2
- internal error: unable to find __cudaPushCallConfiguration declaration. CUDA toolkit installation may be corrupt. HOT 17
- generate-dependencies-with-compile in RTX3060 Cuda11.1 HOT 1
- Cannot import SRU HOT 2
- Unknown builtin op: sru_cuda::sru_bi_forward_simple HOT 2
- FAILED: sru_cuda_kernel.cuda.o
- Any documentation on using SRU++ ? HOT 1
- Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 HOT 9
- Mixed Precision Training HOT 1
- Inference memory leak? HOT 3
- RuntimeError: Caught an unknown exception!
- Columns and DataType Not Explicitly Set on line 205 of train.py
- 运行错误,求大神解决一下,谢谢。
- AttributeError: 'tuple' object has no attribute 'dim'
- RuntimeError: Caught an unknown exception! HOT 1
- Have any predict result?
- Model export onnx
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 sru.