tfr.utils.sort_by_scores
Stay organized with collections
Save and categorize content based on your preferences.
Sorts list of features according to per-example scores.
tfr.utils.sort_by_scores(
scores, features_list, topn=None, shuffle_ties=True, seed=None, mask=None
)
Args |
scores
|
A Tensor of shape [batch_size, list_size] representing the
per-example scores.
|
features_list
|
A list of Tensor s to be sorted. The shape of the Tensor
can be [batch_size, list_size] or [batch_size, list_size, feature_dims].
The latter is applicable for example features.
|
topn
|
An integer as the cutoff of examples in the sorted list.
|
shuffle_ties
|
A boolean. If True, randomly shuffle before the sorting.
|
seed
|
The ops-level random seed used when shuffle_ties is True.
|
mask
|
An optional Tensor of shape [batch_size, list_size] representing
which entries are valid for sorting. Invalid entries will be pushed to the
end.
|
Returns |
A list of Tensor s as the list of sorted features by scores .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-08-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-08-18 UTC."],[],[]]