Skip to content

wurentidai/A-STRUCTURED-SELF-ATTENTIVE-SENTENCE-EMBEDDING

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A STRUCTURED SELF ATTENTIVE SENTENCE EMBEDDING

(This is a sentiment classification model for sentences. )

reference

  1. A STRUCTURED SELF ATTENTIVE SENTENCE EMBEDDING, Z Lin

data reference

  1. polarity reviews

1. Self Attentive Model

기존 attention의 shape은 [batch, seq]의 형태로 나오는데,
self attentive 모델의 경우 row 단위를 확장하여 [batch, seq, rows] 형태를 갖는다.
이때 rows 수 만큼의 독립적인 attention들이 서로 비슷한 모습 혹은 확률 분포를 갖는 경우가 생긴다.
따라서 Frobenius norm을 이용하여 페널티 P = (A * AT − I)**2 를 loss에 더해준다.

2. Test result

About

Implementation of self attentive model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%