0aqz0 / pytorch-attention-mechanism

my codes for learning attention mechanism

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytorch-attention-mechanism

my codes for learning attention mechanism

CNN with attention

Apply spatial attention to CIFAR100 dataset

Usage

Train the model:

$ python cnn-with-attention.py --train

Visualize attention map:

$ python cnn-with-attention.py --visualize

RNN with attention

Apply temporal attention to sequential data

e.g. A sequence of length 20, the output is only related to the 5th position and the 13th position

Usage

Train the model:

$ python rnn-with-attention.py --train

Visualize attention map:

$ python rnn-with-attention.py --visualize

Todos

  • CNN+attention
  • RNN+attention

References

About

my codes for learning attention mechanism


Languages

Language:Python 100.0%