Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 77f2800

Browse files
committed
Update version for release 0.4.0
PiperOrigin-RevId: 375577552
1 parent c2f4aaa commit 77f2800

47 files changed

Lines changed: 559 additions & 488 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tensorflow_ranking/g3doc/api_docs/python/tfr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ library.
5656
__version__<a id="__version__"></a>
5757
</td>
5858
<td>
59-
`'0.3.3.dev'`
59+
`'0.4.0.dev'`
6060
</td>
6161
</tr>
6262
</table>

tensorflow_ranking/g3doc/api_docs/python/tfr/_api_cache.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@
981981
"tfr.keras.model.AbstractModelBuilder.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__",
982982
"tfr.keras.model.AbstractModelBuilder.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__",
983983
"tfr.keras.model.AbstractModelBuilder.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__",
984+
"tfr.keras.model.AbstractModelBuilder.__init__": "tfr.keras.losses.RankingLossKey.__init__",
984985
"tfr.keras.model.AbstractModelBuilder.__le__": "tfr.keras.canned.DNNRankingNetwork.__le__",
985986
"tfr.keras.model.AbstractModelBuilder.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__",
986987
"tfr.keras.model.AbstractModelBuilder.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__",
@@ -1023,7 +1024,14 @@
10231024
"tfr.keras.model.ModelBuilder.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__",
10241025
"tfr.keras.model.ModelBuilder.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__",
10251026
"tfr.keras.model.ModelBuilder.__new__": "tfr.keras.losses.ApproxMRRLoss.__new__",
1026-
"tfr.keras.model.ModelBuilder.build": "tfr.keras.model.AbstractModelBuilder.build",
1027+
"tfr.keras.model.ModelBuilder.build": "tfr.keras.model.ModelBuilderWithMask.build",
1028+
"tfr.keras.model.ModelBuilderWithMask.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__",
1029+
"tfr.keras.model.ModelBuilderWithMask.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__",
1030+
"tfr.keras.model.ModelBuilderWithMask.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__",
1031+
"tfr.keras.model.ModelBuilderWithMask.__le__": "tfr.keras.canned.DNNRankingNetwork.__le__",
1032+
"tfr.keras.model.ModelBuilderWithMask.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__",
1033+
"tfr.keras.model.ModelBuilderWithMask.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__",
1034+
"tfr.keras.model.ModelBuilderWithMask.__new__": "tfr.keras.losses.ApproxMRRLoss.__new__",
10271035
"tfr.keras.model.Preprocessor.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__",
10281036
"tfr.keras.model.Preprocessor.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__",
10291037
"tfr.keras.model.Preprocessor.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__",
@@ -2577,9 +2585,6 @@
25772585
"tfr.keras.model.AbstractModelBuilder.__ne__": true,
25782586
"tfr.keras.model.AbstractModelBuilder.__new__": true,
25792587
"tfr.keras.model.AbstractModelBuilder.build": true,
2580-
"tfr.keras.model.AbstractModelBuilder.create_inputs": true,
2581-
"tfr.keras.model.AbstractModelBuilder.preprocess": true,
2582-
"tfr.keras.model.AbstractModelBuilder.score": true,
25832588
"tfr.keras.model.DNNScorer": false,
25842589
"tfr.keras.model.DNNScorer.__call__": true,
25852590
"tfr.keras.model.DNNScorer.__eq__": true,
@@ -2633,6 +2638,19 @@
26332638
"tfr.keras.model.ModelBuilder.create_inputs": true,
26342639
"tfr.keras.model.ModelBuilder.preprocess": true,
26352640
"tfr.keras.model.ModelBuilder.score": true,
2641+
"tfr.keras.model.ModelBuilderWithMask": false,
2642+
"tfr.keras.model.ModelBuilderWithMask.__eq__": true,
2643+
"tfr.keras.model.ModelBuilderWithMask.__ge__": true,
2644+
"tfr.keras.model.ModelBuilderWithMask.__gt__": true,
2645+
"tfr.keras.model.ModelBuilderWithMask.__init__": true,
2646+
"tfr.keras.model.ModelBuilderWithMask.__le__": true,
2647+
"tfr.keras.model.ModelBuilderWithMask.__lt__": true,
2648+
"tfr.keras.model.ModelBuilderWithMask.__ne__": true,
2649+
"tfr.keras.model.ModelBuilderWithMask.__new__": true,
2650+
"tfr.keras.model.ModelBuilderWithMask.build": true,
2651+
"tfr.keras.model.ModelBuilderWithMask.create_inputs": true,
2652+
"tfr.keras.model.ModelBuilderWithMask.preprocess": true,
2653+
"tfr.keras.model.ModelBuilderWithMask.score": true,
26362654
"tfr.keras.model.Preprocessor": false,
26372655
"tfr.keras.model.Preprocessor.__call__": true,
26382656
"tfr.keras.model.Preprocessor.__eq__": true,

tensorflow_ranking/g3doc/api_docs/python/tfr/_toc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ toc:
223223
path: /ranking/api_docs/python/tfr/keras/model/InputCreator
224224
- title: ModelBuilder
225225
path: /ranking/api_docs/python/tfr/keras/model/ModelBuilder
226+
- title: ModelBuilderWithMask
227+
path: /ranking/api_docs/python/tfr/keras/model/ModelBuilderWithMask
226228
- title: Preprocessor
227229
path: /ranking/api_docs/python/tfr/keras/model/Preprocessor
228230
- title: PreprocessorWithSpec

tensorflow_ranking/g3doc/api_docs/python/tfr/all_symbols.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
* <a href="../tfr/keras/model/GAMScorer.md"><code>tfr.keras.model.GAMScorer</code></a>
101101
* <a href="../tfr/keras/model/InputCreator.md"><code>tfr.keras.model.InputCreator</code></a>
102102
* <a href="../tfr/keras/model/ModelBuilder.md"><code>tfr.keras.model.ModelBuilder</code></a>
103+
* <a href="../tfr/keras/model/ModelBuilderWithMask.md"><code>tfr.keras.model.ModelBuilderWithMask</code></a>
103104
* <a href="../tfr/keras/model/Preprocessor.md"><code>tfr.keras.model.Preprocessor</code></a>
104105
* <a href="../tfr/keras/model/PreprocessorWithSpec.md"><code>tfr.keras.model.PreprocessorWithSpec</code></a>
105106
* <a href="../tfr/keras/model/Scorer.md"><code>tfr.keras.model.Scorer</code></a>

tensorflow_ranking/g3doc/api_docs/python/tfr/keras.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ in Keras.
3737

3838
[`metrics`](../tfr/keras/metrics.md) module: Keras metrics in TF-Ranking.
3939

40-
[`model`](../tfr/keras/model.md) module: Ranking Model utilities and classes in
40+
[`model`](../tfr/keras/model.md) module: Ranking model utilities and classes in
4141
tfr.keras.
4242

4343
[`network`](../tfr/keras/network.md) module: Ranking Networks in Keras.

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/layers/FlattenList.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ flattened_context_features = {'context_feature_1':
6767
flattened_example_features = {'example_feature_1':
6868
[[1], [0], [1], [0], [0], [0]]}
6969
```
70-
7170
`context_feature_1` is repeated by list_size=3 times. `example_feature_1` is
7271
flattened and padded with the invalid terms replaced by valid terms in each
7372
query in a circular way.

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ description: Keras metrics in TF-Ranking.
2020

2121
Keras metrics in TF-Ranking.
2222

23+
NOTE: For metrics that compute a ranking, ties are broken randomly. This means
24+
that metrics may be stochastic if items with equal scores are provided.
25+
26+
WARNING: Some metrics (e.g. Recall or MRR) are not well-defined when there are
27+
no relevant items (e.g. if `y_true` has a row of only zeroes). For these cases,
28+
the TF-Ranking metrics will evaluate to `0`.
29+
2330
## Classes
2431

2532
[`class ARPMetric`](../../tfr/keras/metrics/ARPMetric.md): Average relevance

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/ARPMetric.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ description: Average relevance position (ARP).
2828

2929
<table class="tfo-notebook-buttons tfo-api nocontent" align="left">
3030
<td>
31-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L235-L278">
31+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L243-L286">
3232
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
3333
View source on GitHub
3434
</a>
@@ -783,7 +783,7 @@ layer's specifications.
783783

784784
<h3 id="update_state"><code>update_state</code></h3>
785785

786-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L145-L167">View
786+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L153-L175">View
787787
source</a>
788788

789789
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/AlphaDCGMetric.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ description: Alpha discounted cumulative gain (alphaDCG).
2828

2929
<table class="tfo-notebook-buttons tfo-api nocontent" align="left">
3030
<td>
31-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L780-L902">
31+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L788-L910">
3232
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
3333
View source on GitHub
3434
</a>
@@ -731,7 +731,7 @@ A layer instance.
731731

732732
<h3 id="get_config"><code>get_config</code></h3>
733733

734-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L894-L902">View
734+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L902-L910">View
735735
source</a>
736736

737737
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
@@ -889,7 +889,7 @@ layer's specifications.
889889

890890
<h3 id="update_state"><code>update_state</code></h3>
891891

892-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L145-L167">View
892+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L153-L175">View
893893
source</a>
894894

895895
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/DCGMetric.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ description: Discounted cumulative gain (DCG).
2828

2929
<table class="tfo-notebook-buttons tfo-api nocontent" align="left">
3030
<td>
31-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L695-L776">
31+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L703-L784">
3232
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
3333
View source on GitHub
3434
</a>
@@ -644,7 +644,7 @@ A layer instance.
644644

645645
<h3 id="get_config"><code>get_config</code></h3>
646646

647-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L768-L776">View
647+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L776-L784">View
648648
source</a>
649649

650650
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
@@ -802,7 +802,7 @@ layer's specifications.
802802

803803
<h3 id="update_state"><code>update_state</code></h3>
804804

805-
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L145-L167">View
805+
<a target="_blank" href="https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/keras/metrics.py#L153-L175">View
806806
source</a>
807807

808808
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">

0 commit comments

Comments
 (0)