Skip to content

0aqz0/pytorch-attention-mechanism

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages