View source on GitHub |
Keras serializable class for YetiDCGLambdaWeight.
tfr.keras.losses.YetiDCGLambdaWeight(
topn: Optional[int] = None,
gain_fn: Optional[tfr.keras.utils.GainFunction
] = None,
rank_discount_fn: Optional[tfr.keras.utils.GainFunction
] = None,
normalized: bool = False,
**kwargs
)
Args | |
---|---|
topn
|
(int) The topn for the DCG metric. |
gain_fn
|
(function) Transforms labels. |
rank_discount_fn
|
(function) The rank discount function. |
normalized
|
(bool) If True, normalize weight by the max DCG. |
Methods
get_config
get_config() -> Dict[str, Any]
individual_weights
individual_weights(
labels, ranks
)
See _LambdaWeight
.
pair_weights
pair_weights(
labels: tf.Tensor, ranks: tf.Tensor
) -> tf.Tensor
See _LambdaWeight
.