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

Commit 6cf8f70

Browse files
committed
Expose premade package. Update version to release 0.4.2.
PiperOrigin-RevId: 386338223
1 parent e0c009e commit 6cf8f70

32 files changed

+3402
-72
lines changed

tensorflow_ranking/examples/keras/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ py_library(
184184
# tensorflow_models/official/core:config_definitions dep,
185185
# tensorflow_models/official/core:exp_factory dep,
186186
# tensorflow_models/official/modeling/optimization dep,
187-
"//tensorflow_ranking/python/keras/premade:tfrbert_task",
187+
"//tensorflow_ranking",
188188
],
189189
)
190190

tensorflow_ranking/examples/keras/tfrbert_task_experiments.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@
1818
from official.core import config_definitions as cfg
1919
from official.core import exp_factory
2020
from official.modeling import optimization
21-
from tensorflow_ranking.python.keras.premade import tfrbert_task
21+
import tensorflow_ranking as tfr
2222

2323

2424
@exp_factory.register_config_factory('tfr_bert')
2525
def tfrbert_exp() -> cfg.ExperimentConfig:
2626
"""Defines a TFR-BERT experiment."""
2727
config = cfg.ExperimentConfig(
28-
task=tfrbert_task.TFRBertConfig(
29-
train_data=tfrbert_task.TFRBertDataConfig(),
30-
validation_data=tfrbert_task.TFRBertDataConfig(
31-
is_training=False,
32-
drop_remainder=False)),
28+
task=tfr.keras.premade.TFRBertConfig(
29+
train_data=tfr.keras.premade.TFRBertDataConfig(),
30+
validation_data=tfr.keras.premade.TFRBertDataConfig(
31+
is_training=False, drop_remainder=False)),
3332
trainer=cfg.TrainerConfig(
3433
optimizer_config=optimization.OptimizationConfig({
3534
'optimizer': {

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.4.1.dev'`
59+
`'0.4.2.dev'`
6060
</td>
6161
</tr>
6262
</table>

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

Lines changed: 594 additions & 14 deletions
Large diffs are not rendered by default.

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,23 @@ redirects:
33
to: /ranking/api_docs/python/tfr/keras/canned/DNNRankingNetwork
44
- from: /ranking/api_docs/python/tfr/keras/canned/gam/GAMRankingNetwork
55
to: /ranking/api_docs/python/tfr/keras/canned/GAMRankingNetwork
6+
- from: /ranking/api_docs/python/tfr/keras/premade/TensorLike
7+
to: /ranking/api_docs/python/tfr/keras/model/TensorLike
8+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertConfig
9+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertConfig
10+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertDataConfig
11+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertDataConfig
12+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertDataLoader
13+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertDataLoader
14+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertModelBuilder
15+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertModelBuilder
16+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertModelConfig
17+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertModelConfig
18+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertScorer
19+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertScorer
20+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TFRBertTask
21+
to: /ranking/api_docs/python/tfr/keras/premade/TFRBertTask
22+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TensorDict
23+
to: /ranking/api_docs/python/tfr/keras/premade/TensorDict
24+
- from: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task/TensorLike
25+
to: /ranking/api_docs/python/tfr/keras/model/TensorLike

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,30 @@ toc:
279279
path: /ranking/api_docs/python/tfr/keras/pipeline/SimpleDatasetBuilder
280280
- title: SimplePipeline
281281
path: /ranking/api_docs/python/tfr/keras/pipeline/SimplePipeline
282+
- title: premade
283+
section:
284+
- title: Overview
285+
path: /ranking/api_docs/python/tfr/keras/premade
286+
- title: TFRBertConfig
287+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertConfig
288+
- title: TFRBertDataConfig
289+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertDataConfig
290+
- title: TFRBertDataLoader
291+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertDataLoader
292+
- title: TFRBertModelBuilder
293+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertModelBuilder
294+
- title: TFRBertModelConfig
295+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertModelConfig
296+
- title: TFRBertScorer
297+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertScorer
298+
- title: TFRBertTask
299+
path: /ranking/api_docs/python/tfr/keras/premade/TFRBertTask
300+
- title: TensorDict
301+
path: /ranking/api_docs/python/tfr/keras/premade/TensorDict
302+
- title: tfrbert_task
303+
section:
304+
- title: Overview
305+
path: /ranking/api_docs/python/tfr/keras/premade/tfrbert_task
282306
- title: saved_model
283307
section:
284308
- title: Overview

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@
126126
* <a href="../tfr/keras/pipeline/PipelineHparams.md"><code>tfr.keras.pipeline.PipelineHparams</code></a>
127127
* <a href="../tfr/keras/pipeline/SimpleDatasetBuilder.md"><code>tfr.keras.pipeline.SimpleDatasetBuilder</code></a>
128128
* <a href="../tfr/keras/pipeline/SimplePipeline.md"><code>tfr.keras.pipeline.SimplePipeline</code></a>
129+
* <a href="../tfr/keras/premade.md"><code>tfr.keras.premade</code></a>
130+
* <a href="../tfr/keras/premade/TFRBertConfig.md"><code>tfr.keras.premade.TFRBertConfig</code></a>
131+
* <a href="../tfr/keras/premade/TFRBertDataConfig.md"><code>tfr.keras.premade.TFRBertDataConfig</code></a>
132+
* <a href="../tfr/keras/premade/TFRBertDataLoader.md"><code>tfr.keras.premade.TFRBertDataLoader</code></a>
133+
* <a href="../tfr/keras/premade/TFRBertModelBuilder.md"><code>tfr.keras.premade.TFRBertModelBuilder</code></a>
134+
* <a href="../tfr/keras/premade/TFRBertModelConfig.md"><code>tfr.keras.premade.TFRBertModelConfig</code></a>
135+
* <a href="../tfr/keras/premade/TFRBertScorer.md"><code>tfr.keras.premade.TFRBertScorer</code></a>
136+
* <a href="../tfr/keras/premade/TFRBertTask.md"><code>tfr.keras.premade.TFRBertTask</code></a>
137+
* <a href="../tfr/keras/premade/TensorDict.md"><code>tfr.keras.premade.TensorDict</code></a>
138+
* <a href="../tfr/keras/model/TensorLike.md"><code>tfr.keras.premade.TensorLike</code></a>
139+
* <a href="../tfr/keras/premade/tfrbert_task.md"><code>tfr.keras.premade.tfrbert_task</code></a>
140+
* <a href="../tfr/keras/premade/TFRBertConfig.md"><code>tfr.keras.premade.tfrbert_task.TFRBertConfig</code></a>
141+
* <a href="../tfr/keras/premade/TFRBertDataConfig.md"><code>tfr.keras.premade.tfrbert_task.TFRBertDataConfig</code></a>
142+
* <a href="../tfr/keras/premade/TFRBertDataLoader.md"><code>tfr.keras.premade.tfrbert_task.TFRBertDataLoader</code></a>
143+
* <a href="../tfr/keras/premade/TFRBertModelBuilder.md"><code>tfr.keras.premade.tfrbert_task.TFRBertModelBuilder</code></a>
144+
* <a href="../tfr/keras/premade/TFRBertModelConfig.md"><code>tfr.keras.premade.tfrbert_task.TFRBertModelConfig</code></a>
145+
* <a href="../tfr/keras/premade/TFRBertScorer.md"><code>tfr.keras.premade.tfrbert_task.TFRBertScorer</code></a>
146+
* <a href="../tfr/keras/premade/TFRBertTask.md"><code>tfr.keras.premade.tfrbert_task.TFRBertTask</code></a>
147+
* <a href="../tfr/keras/premade/TensorDict.md"><code>tfr.keras.premade.tfrbert_task.TensorDict</code></a>
148+
* <a href="../tfr/keras/model/TensorLike.md"><code>tfr.keras.premade.tfrbert_task.TensorLike</code></a>
129149
* <a href="../tfr/keras/saved_model.md"><code>tfr.keras.saved_model</code></a>
130150
* <a href="../tfr/keras/saved_model/Signatures.md"><code>tfr.keras.saved_model.Signatures</code></a>
131151
* <a href="../tfr/keras/strategy_utils.md"><code>tfr.keras.strategy_utils</code></a>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ tfr.keras.
4545
[`pipeline`](../tfr/keras/pipeline.md) module: Ranking pipeline to train
4646
tf.keras.Model in tfr.keras.
4747

48+
[`premade`](../tfr/keras/premade.md) module: TensorFlow Ranking Premade Orbit
49+
Task Module.
50+
4851
[`saved_model`](../tfr/keras/saved_model.md) module: SavedModel utilities for
4952
TF-Ranking.
5053

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ description: The central part of internal API.
88
# tfr.keras.model.TensorDict
99

1010
<!-- Insert buttons and diff -->
11-
1211
This symbol is a **type alias**.
1312

1413
The central part of internal API.

tensorflow_ranking/g3doc/api_docs/python/tfr/keras/pipeline/DatasetHparams/dataset_reader.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ batch.
566566
</table>
567567

568568
<!-- Tabular view -->
569-
570569
<table class="responsive fixed orange">
571570
<colgroup><col width="214px"><col></colgroup>
572571
<tr><th colspan="2">Returns</th></tr>
@@ -1504,7 +1503,6 @@ the same key to combine in a single batch, which will be passed to
15041503
</table>
15051504

15061505
<!-- Tabular view -->
1507-
15081506
<table class="responsive fixed orange">
15091507
<colgroup><col width="214px"><col></colgroup>
15101508
<tr><th colspan="2">Returns</th></tr>
@@ -2499,7 +2497,6 @@ accumulates one or more state tensors, whose initial values are `initial_state`.
24992497
```
25002498

25012499
<!-- Tabular view -->
2502-
25032500
<table class="responsive fixed orange">
25042501
<colgroup><col width="214px"><col></colgroup>
25052502
<tr><th colspan="2">Args</th></tr>
@@ -2526,7 +2523,6 @@ structure of `initial_state`.
25262523
</table>
25272524

25282525
<!-- Tabular view -->
2529-
25302526
<table class="responsive fixed orange">
25312527
<colgroup><col width="214px"><col></colgroup>
25322528
<tr><th colspan="2">Returns</th></tr>
@@ -2874,7 +2870,6 @@ By default, snapshot parallelizes reads by the number of cores available on the
28742870
system, but will not attempt to shuffle the data.
28752871

28762872
<!-- Tabular view -->
2877-
28782873
<table class="responsive fixed orange">
28792874
<colgroup><col width="214px"><col></colgroup>
28802875
<tr><th colspan="2">Args</th></tr>
@@ -2917,7 +2912,6 @@ a snapshot.
29172912
</table>
29182913

29192914
<!-- Tabular view -->
2920-
29212915
<table class="responsive fixed orange">
29222916
<colgroup><col width="214px"><col></colgroup>
29232917
<tr><th colspan="2">Returns</th></tr>
@@ -2997,7 +2991,6 @@ A transformation that stops dataset iteration based on a `predicate`.
29972991
```
29982992

29992993
<!-- Tabular view -->
3000-
30012994
<table class="responsive fixed orange">
30022995
<colgroup><col width="214px"><col></colgroup>
30032996
<tr><th colspan="2">Args</th></tr>
@@ -3015,7 +3008,6 @@ shapes and types defined by `self.output_shapes` and
30153008
</table>
30163009

30173010
<!-- Tabular view -->
3018-
30193011
<table class="responsive fixed orange">
30203012
<colgroup><col width="214px"><col></colgroup>
30213013
<tr><th colspan="2">Returns</th></tr>
@@ -3086,7 +3078,6 @@ Note: This transformation only supports datasets which fit into memory and have
30863078
elements of either `tf.int32`, `tf.int64` or `tf.string` type.
30873079

30883080
<!-- Tabular view -->
3089-
30903081
<table class="responsive fixed orange">
30913082
<colgroup><col width="214px"><col></colgroup>
30923083
<tr><th colspan="2">Returns</th></tr>

0 commit comments

Comments
 (0)