Creates a Functional Keras ranking model.

A mask is inferred from size_feature_name and passed to the network, along with feature dictionary as inputs.

network ( A ranking network which generates a list of scores.
loss (tfr.keras.losses._RankingLoss) A ranking loss.
metrics (list) List of ranking metrics, tfr.keras.metrics._RankingMetric instances.
optimizer (tf.keras.optimizer.Optimizer) Optimizer to minimize ranking loss.
size_feature_name (str) Name of feature for example list sizes. If not None, this feature name corresponds to a tf.int32 Tensor of size [batch_size] corresponding to sizes of example lists. If None, all examples are treated as valid.
list_size (int) The list size for example features. If None, use dynamic list size. A fixed list size is required for TPU training.

A compiled ranking Keras model, a tf.keras.Model instance.