tensorflow学习笔记
libcorner / tensorflow_note Goto Github PK
View Code? Open in Web Editor NEWtensorflow学习笔记
tensorflow学习笔记
非常感谢你的笔记!
我看到您对于Attention Wrappers的计算过程进行了总结:
每个时刻的基本计算过程为:
1) cell_inputs = concat([inputs, prev_state.attention], -1) #inputs与attention结合
2) cell_output, next_cell_state = cell(cell_inputs, prev_state.cell_state) #rnncell的输出
3) score = attention_mechanism(cell_output) #计算attention得分
4) alignments = softmax(score)
我查看了TensorFlow的源码,https://github.com/tensorflow/tensorflow/blob/r1.5/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py 其中第1325行和1353行应该分别对应你的第2. 3两点。但是我对此有些疑问,我认为attention机制时输入应该是Decoder的第i-1阶段的隐状态和Encoder第j个阶段的隐状态,但是您的第(3)点(也就是源码的第1353行)是将cell_output而不是next_cell_output传入attention_mechanism,这让我感觉很困惑。根据论文以及我查到的其他一些资料(如https://zhuanlan.zhihu.com/p/28054589 和http://blog.csdn.net/qq_21190081/article/details/53083516 ),都是利用Encoder的隐状态而非Encoder的输出来做attention的,我也在tensorflow/tensorflow#16287 看到有人提出了相同的问题。不知您能否解决我的困惑。非常感谢!
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.