Deep auditory encoding with self-attention to predict brain activity

Deep auditory encoding with self-attention to predict brain activity | Moritz Boos

This library allows you to train a recurrent DNN (a GRU) and learn a self-attention mechanism that weighs hidden states - the resulting weighted tensor is used to predict brain activity (or whatever you choose as a target). It also contains many variations of this model type (shared attention between targets, multi-head attention etc) and some functions for visualizing the computed attention weights on a spectrogram.

The general idea is captured in this figure:

attention model

Read more in this blogpost!