-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update all sanning utility with code from seismo-performer repo
- Loading branch information
Showing
26 changed files
with
2,217 additions
and
1,393 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Tensorflow Variant of FAVOR+. | ||
|
||
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()`. | ||
|
||
## Notes: | ||
|
||
* Just like the Jax case, the causal (unidirectional) variant uses custom gradients via `@tf.custom_gradient`, in order to provide significant memory reductions. | ||
|
||
|
Oops, something went wrong.