danipozo / performer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tensorflow Variant of FAVOR+.

Taken from Google Research repo performer subdirectory, in order to use it as a submodule.

The main attention function in the Tensorflow variant is favor_attention.

  • In order to use softmax attention, set its argument kernel_transformation=softmax_kernel_transformation.
  • In order to use generalized ReLU attention, set its argument kernel_transformation=relu_kernel_transformation.

To use as a tf.keras.layers.Layer module, use the FAVOR Attention class instead (after setting the FAVOR+ configuration). This has a similar API to tf.keras.layers.Attention().

About


Languages

Language:Python 100.0%