From 77f280075e220946d0935b44b64770f4dabb37d0 Mon Sep 17 00:00:00 2001 From: Rama Pasumarthi Date: Mon, 24 May 2021 19:02:02 -0400 Subject: [PATCH] Update version for release 0.4.0 PiperOrigin-RevId: 375577552 --- .../g3doc/api_docs/python/tfr.md | 2 +- .../g3doc/api_docs/python/tfr/_api_cache.json | 26 +- .../g3doc/api_docs/python/tfr/_toc.yaml | 2 + .../g3doc/api_docs/python/tfr/all_symbols.md | 1 + .../g3doc/api_docs/python/tfr/keras.md | 2 +- .../python/tfr/keras/layers/FlattenList.md | 1 - .../api_docs/python/tfr/keras/metrics.md | 7 + .../python/tfr/keras/metrics/ARPMetric.md | 4 +- .../tfr/keras/metrics/AlphaDCGMetric.md | 6 +- .../python/tfr/keras/metrics/DCGMetric.md | 6 +- .../python/tfr/keras/metrics/MRRMetric.md | 6 +- .../metrics/MeanAveragePrecisionMetric.md | 6 +- .../python/tfr/keras/metrics/NDCGMetric.md | 6 +- .../python/tfr/keras/metrics/OPAMetric.md | 4 +- .../tfr/keras/metrics/PrecisionIAMetric.md | 7 +- .../tfr/keras/metrics/PrecisionMetric.md | 6 +- .../tfr/keras/metrics/RankingMetricKey.md | 2 +- .../python/tfr/keras/metrics/RecallMetric.md | 6 +- .../keras/metrics/default_keras_metrics.md | 3 +- .../api_docs/python/tfr/keras/metrics/get.md | 2 +- .../g3doc/api_docs/python/tfr/keras/model.md | 9 +- .../tfr/keras/model/AbstractModelBuilder.md | 353 +--------------- .../python/tfr/keras/model/DNNScorer.md | 5 +- .../keras/model/FeatureSpecInputCreator.md | 5 +- .../python/tfr/keras/model/GAMScorer.md | 5 +- .../python/tfr/keras/model/InputCreator.md | 5 +- .../python/tfr/keras/model/ModelBuilder.md | 21 +- .../tfr/keras/model/ModelBuilderWithMask.md | 378 ++++++++++++++++++ .../python/tfr/keras/model/Preprocessor.md | 6 +- .../tfr/keras/model/PreprocessorWithSpec.md | 4 +- .../api_docs/python/tfr/keras/model/Scorer.md | 4 +- .../tfr/keras/model/TypeSpecInputCreator.md | 5 +- .../tfr/keras/model/UnivariateScorer.md | 4 +- .../keras/pipeline/AbstractDatasetBuilder.md | 6 - .../tfr/keras/pipeline/AbstractPipeline.md | 5 - .../tfr/keras/pipeline/BaseDatasetBuilder.md | 8 +- .../tfr/keras/pipeline/DatasetHparams.md | 3 +- .../tfr/keras/pipeline/ModelFitPipeline.md | 16 +- .../pipeline/MultiLabelDatasetBuilder.md | 8 +- .../tfr/keras/pipeline/MultiTaskPipeline.md | 23 +- .../tfr/keras/pipeline/NullDatasetBuilder.md | 9 +- .../tfr/keras/pipeline/PipelineHparams.md | 18 +- .../keras/pipeline/SimpleDatasetBuilder.md | 8 +- .../tfr/keras/pipeline/SimplePipeline.md | 23 +- .../api_docs/python/tfr/metrics/recall.md | 3 +- tensorflow_ranking/python/version.py | 4 +- tensorflow_ranking/tools/pip_package/setup.py | 4 +- 47 files changed, 559 insertions(+), 488 deletions(-) create mode 100644 tensorflow_ranking/g3doc/api_docs/python/tfr/keras/model/ModelBuilderWithMask.md diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr.md b/tensorflow_ranking/g3doc/api_docs/python/tfr.md index aeec5df..aa9e9b7 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr.md @@ -56,7 +56,7 @@ library. __version__ -`'0.3.3.dev'` +`'0.4.0.dev'` diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/_api_cache.json b/tensorflow_ranking/g3doc/api_docs/python/tfr/_api_cache.json index 6ec5e95..0b92023 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/_api_cache.json +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/_api_cache.json @@ -981,6 +981,7 @@ "tfr.keras.model.AbstractModelBuilder.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__", "tfr.keras.model.AbstractModelBuilder.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__", "tfr.keras.model.AbstractModelBuilder.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__", + "tfr.keras.model.AbstractModelBuilder.__init__": "tfr.keras.losses.RankingLossKey.__init__", "tfr.keras.model.AbstractModelBuilder.__le__": "tfr.keras.canned.DNNRankingNetwork.__le__", "tfr.keras.model.AbstractModelBuilder.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__", "tfr.keras.model.AbstractModelBuilder.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__", @@ -1023,7 +1024,14 @@ "tfr.keras.model.ModelBuilder.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__", "tfr.keras.model.ModelBuilder.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__", "tfr.keras.model.ModelBuilder.__new__": "tfr.keras.losses.ApproxMRRLoss.__new__", - "tfr.keras.model.ModelBuilder.build": "tfr.keras.model.AbstractModelBuilder.build", + "tfr.keras.model.ModelBuilder.build": "tfr.keras.model.ModelBuilderWithMask.build", + "tfr.keras.model.ModelBuilderWithMask.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__", + "tfr.keras.model.ModelBuilderWithMask.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__", + "tfr.keras.model.ModelBuilderWithMask.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__", + "tfr.keras.model.ModelBuilderWithMask.__le__": "tfr.keras.canned.DNNRankingNetwork.__le__", + "tfr.keras.model.ModelBuilderWithMask.__lt__": "tfr.keras.canned.DNNRankingNetwork.__lt__", + "tfr.keras.model.ModelBuilderWithMask.__ne__": "tfr.keras.canned.DNNRankingNetwork.__ne__", + "tfr.keras.model.ModelBuilderWithMask.__new__": "tfr.keras.losses.ApproxMRRLoss.__new__", "tfr.keras.model.Preprocessor.__eq__": "tfr.keras.canned.DNNRankingNetwork.__eq__", "tfr.keras.model.Preprocessor.__ge__": "tfr.keras.canned.DNNRankingNetwork.__ge__", "tfr.keras.model.Preprocessor.__gt__": "tfr.keras.canned.DNNRankingNetwork.__gt__", @@ -2577,9 +2585,6 @@ "tfr.keras.model.AbstractModelBuilder.__ne__": true, "tfr.keras.model.AbstractModelBuilder.__new__": true, "tfr.keras.model.AbstractModelBuilder.build": true, - "tfr.keras.model.AbstractModelBuilder.create_inputs": true, - "tfr.keras.model.AbstractModelBuilder.preprocess": true, - "tfr.keras.model.AbstractModelBuilder.score": true, "tfr.keras.model.DNNScorer": false, "tfr.keras.model.DNNScorer.__call__": true, "tfr.keras.model.DNNScorer.__eq__": true, @@ -2633,6 +2638,19 @@ "tfr.keras.model.ModelBuilder.create_inputs": true, "tfr.keras.model.ModelBuilder.preprocess": true, "tfr.keras.model.ModelBuilder.score": true, + "tfr.keras.model.ModelBuilderWithMask": false, + "tfr.keras.model.ModelBuilderWithMask.__eq__": true, + "tfr.keras.model.ModelBuilderWithMask.__ge__": true, + "tfr.keras.model.ModelBuilderWithMask.__gt__": true, + "tfr.keras.model.ModelBuilderWithMask.__init__": true, + "tfr.keras.model.ModelBuilderWithMask.__le__": true, + "tfr.keras.model.ModelBuilderWithMask.__lt__": true, + "tfr.keras.model.ModelBuilderWithMask.__ne__": true, + "tfr.keras.model.ModelBuilderWithMask.__new__": true, + "tfr.keras.model.ModelBuilderWithMask.build": true, + "tfr.keras.model.ModelBuilderWithMask.create_inputs": true, + "tfr.keras.model.ModelBuilderWithMask.preprocess": true, + "tfr.keras.model.ModelBuilderWithMask.score": true, "tfr.keras.model.Preprocessor": false, "tfr.keras.model.Preprocessor.__call__": true, "tfr.keras.model.Preprocessor.__eq__": true, diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/_toc.yaml b/tensorflow_ranking/g3doc/api_docs/python/tfr/_toc.yaml index 9101b77..21c5adf 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/_toc.yaml +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/_toc.yaml @@ -223,6 +223,8 @@ toc: path: /ranking/api_docs/python/tfr/keras/model/InputCreator - title: ModelBuilder path: /ranking/api_docs/python/tfr/keras/model/ModelBuilder + - title: ModelBuilderWithMask + path: /ranking/api_docs/python/tfr/keras/model/ModelBuilderWithMask - title: Preprocessor path: /ranking/api_docs/python/tfr/keras/model/Preprocessor - title: PreprocessorWithSpec diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/all_symbols.md b/tensorflow_ranking/g3doc/api_docs/python/tfr/all_symbols.md index aab4a34..d852147 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/all_symbols.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/all_symbols.md @@ -100,6 +100,7 @@ * tfr.keras.model.GAMScorer * tfr.keras.model.InputCreator * tfr.keras.model.ModelBuilder +* tfr.keras.model.ModelBuilderWithMask * tfr.keras.model.Preprocessor * tfr.keras.model.PreprocessorWithSpec * tfr.keras.model.Scorer diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras.md b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras.md index 1b16000..ac4ae06 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras.md @@ -37,7 +37,7 @@ in Keras. [`metrics`](../tfr/keras/metrics.md) module: Keras metrics in TF-Ranking. -[`model`](../tfr/keras/model.md) module: Ranking Model utilities and classes in +[`model`](../tfr/keras/model.md) module: Ranking model utilities and classes in tfr.keras. [`network`](../tfr/keras/network.md) module: Ranking Networks in Keras. diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/layers/FlattenList.md b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/layers/FlattenList.md index f70f4ca..ba27b55 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/layers/FlattenList.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/layers/FlattenList.md @@ -67,7 +67,6 @@ flattened_context_features = {'context_feature_1': flattened_example_features = {'example_feature_1': [[1], [0], [1], [0], [0], [0]]} ``` - `context_feature_1` is repeated by list_size=3 times. `example_feature_1` is flattened and padded with the invalid terms replaced by valid terms in each query in a circular way. diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics.md b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics.md index 144238f..8fc3aeb 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics.md @@ -20,6 +20,13 @@ description: Keras metrics in TF-Ranking. Keras metrics in TF-Ranking. +NOTE: For metrics that compute a ranking, ties are broken randomly. This means +that metrics may be stochastic if items with equal scores are provided. + +WARNING: Some metrics (e.g. Recall or MRR) are not well-defined when there are +no relevant items (e.g. if `y_true` has a row of only zeroes). For these cases, +the TF-Ranking metrics will evaluate to `0`. + ## Classes [`class ARPMetric`](../../tfr/keras/metrics/ARPMetric.md): Average relevance diff --git a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/ARPMetric.md b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/ARPMetric.md index a2206ec..540c88f 100644 --- a/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/ARPMetric.md +++ b/tensorflow_ranking/g3doc/api_docs/python/tfr/keras/metrics/ARPMetric.md @@ -28,7 +28,7 @@ description: Average relevance position (ARP).