View source on GitHub
|
Keras serializable class for LabelDiffLambdaWeight.
tfr.keras.losses.LabelDiffLambdaWeight(
**kwargs
)
Methods
get_config
get_config() -> Dict[str, Any]
individual_weights
individual_weights(
labels, ranks
)
Returns the weight Tensor for individual examples.
| Args | |
|---|---|
labels
|
A dense Tensor of labels with shape [batch_size, list_size].
|
ranks
|
A dense Tensor of ranks with the same shape as labels that are
sorted by logits.
|
| Returns | |
|---|---|
A Tensor that can weight individual examples.
|
pair_weights
pair_weights(
labels, ranks
)
Returns the absolute label difference for each pair.
View source on GitHub