# Module: tfr.keras.layers

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/ranking/blob/v0.5.3/tensorflow_ranking/python/keras/layers.py) |

Defines Keras Layers for TF-Ranking.

## Classes

[`class Bilinear`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/Bilinear): A Keras Layer makes bilinear interaction of two vectors.

[`class ConcatFeatures`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/ConcatFeatures): Concatenates context features and example features in a listwise manner.

[`class DocumentInteractionAttention`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/DocumentInteractionAttention): Cross Document Interaction Attention layer.

[`class FlattenList`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/FlattenList): Layer to flatten the example list.

[`class GAMLayer`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/GAMLayer): Defines a generalized additive model (GAM) layer.

[`class RestoreList`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/RestoreList): Output layer to restore listwise output shape.

[`class SelfAttentionMask`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/SelfAttentionMask): Create 3D attention mask from a 2D tensor mask.

## Functions

[`create_tower(...)`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/layers/create_tower): Creates a feed-forward network as [`tf.keras.Sequential`](https://www.tensorflow.org/api_docs/python/tf/keras/Sequential).