Giter Club home page Giter Club logo

lstm_attention's Introduction

LSTM_Attention

X = Input Sequence of length n.
H = LSTM(X); Note that here the LSTM has return_sequences = True,
    so H is a sequence of vectors of length n.
s is the hidden state of the LSTM (h and c)

h is a weighted sum over H: 加权和
h = sigma(j = 0 to n-1)  alpha(j) * H(j)

weight alpha[i, j] for each hj is computed as follows:
H = [h1,h2,...,hn]
M = tanh(H)
alhpa = softmax(w.transpose * M)

h# = tanh(h)
y = softmax(W * h# + b)

J(theta) = negative_log_likelihood + regularity

attModel1

GitHub 项目

datalogue/keras-attention

1

Attention_Recurrent

GitHub 项目

ningshixian/LSTM_Attention

attModel2

GitHub 项目

Keras Attention Mechanism

Example: Attention block*

Attention defined per time series (each TS has its own attention)

attModel3

Github 项目

keras-language-modeling

https://github.com/roebius/deeplearning_keras2/blob/master/nbs2/attention_wrapper.py

attModel4

Github 项目

CDRextraction

hierarchical-attention-networks

Github:

synthesio/hierarchical-attention-networks

self-attention-networks

参考

lstm_attention's People

Contributors

ningshixian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lstm_attention's Issues

AttentionLSTM and AttentionLSTM_t

Thanks and I have following questions:

  1. what is the difference of AttentionLSTM and AttentionLSTM_t in your code attention_lstm.py? (i.e. what do you mean by 'attention_vec'?)

  2. Is the output at each timestep is the input to the next timestep in AttentionLSTM_t?

self_attention 第167行的问题,谢谢!

你好,我在运行你的这个程序时,第167行报错:TypeError: add_weight() got multiple values for argument 'name',我用的是anaconda3+python3.6+keras2.3.1+tensorflow2.1.0,不知道你有什么建议吗?

process_data

Hello ningshixian
i fail to reproduce your fantastic work, it report as "NO module like process_data". could you give me some advice

AttentionDecoder 输入的time_step必须要和encoder的time_step一样?

您好,看了您的Git受益匪浅,有个小疑问:AttentionDecoder 输入的time_step必须要和encoder的time_step一样,那么AttentionDecoder 输出的time_step也就等于encoder的time_step,可是输入和输出的time_step数量一般情况下是不一样的啊?比如输入的是个问题,输出的是个答案,问题和答案的词数量一般都不一样。

About Attention

What should I do if I follow the attention layer behind the CRF layer?

AttentionLSTM

想问下AttentionLSTM中的参数attention_vec表示什么,怎么用?
运行时提示“'AttentionLSTM' object has no attribute 'inner_init'”错误

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.