View source on GitHub |
Computes 1./log2(1+x)
element-wise for each label.
tfr.keras.utils.log2_inverse(
rank: tfr.keras.model.TensorLike
) -> tf.Tensor
Can be used to define rank_discount_fn
for tfr.keras.metrics.NDCGMetric
.
Args | |
---|---|
rank
|
A Tensor or anything that can be converted to a tensor using
tf.convert_to_tensor .
|
Returns | |
---|---|
A Tensor that has each input element transformed as x to 1./log2(1+x) .
|