diff options
author | Zhenyu Tan <tanzheny@google.com> | 2018-09-11 15:28:10 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-11 15:32:14 -0700 |
commit | 7f9f25a008369ac90e7b96c4f58a3dd1c662d89c (patch) | |
tree | de12bfe3abd1c209471d99e22b61b753c8323c23 /tensorflow/core/api_def | |
parent | 4754b8518c8396e91fbc1234746a036596788e3b (diff) |
Move Quantile Stream Resource to core.
Allow each Resource to manage multiple streams that share the same quantile config -- number of quantiles and epsilon. Previously each resource manage only one stream, so we will have to create resources equal to the number of features, which is cumbersome when input is high dimensional. If 1000 features use 100 quantiles (which is hardcoded today), then 1000 resources is required. This cl will create the number of resources linear to the number of parameter servers, if 2 parameter servers are present, then only 2 resources is required, one for each ps.
Remove time stamp token as the ops are called once.
PiperOrigin-RevId: 212533735
Diffstat (limited to 'tensorflow/core/api_def')
8 files changed, 208 insertions, 0 deletions
diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesBucketize.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesBucketize.pbtxt new file mode 100644 index 0000000000..cdaeb5091c --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesBucketize.pbtxt @@ -0,0 +1,34 @@ +op { + graph_op_name: "BoostedTreesBucketize" + visibility: HIDDEN + in_arg { + name: "float_values" + description: <<END +float; List of Rank 2 Tensor each containing float values for a single feature. +END + } + in_arg { + name: "bucket_boundaries" + description: <<END +float; List of Rank 1 Tensors each containing the bucket boundaries for a single +feature. +END + } + out_arg { + name: "buckets" + description: <<END +int; List of Rank 2 Tensors each containing the bucketized values for a single feature. +END + } + attr { + name: "num_features" + description: <<END +inferred int; number of features. +END + } + summary: "Bucketize each feature based on bucket boundaries." + description: <<END +An op that returns a list of float tensors, where each tensor represents the +bucketized values for a single feature. +END +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt new file mode 100644 index 0000000000..20da1295f6 --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt @@ -0,0 +1,29 @@ +op { + graph_op_name: "BoostedTreesCreateQuantileStreamResource" + visibility: HIDDEN + in_arg { + name: "quantile_stream_resource_handle" + description: <<END +resource; Handle to quantile stream resource. +END + } + in_arg { + name: "epsilon" + description: <<END +float; The required approximation error of the stream resource. +END + } + in_arg { + name: "num_streams" + description: <<END +int; The number of streams managed by the resource that shares the same epsilon. +END + } + attr { + name: "max_elements" + description : <<END +int; The maximum number of data points that can be fed to the stream. +END + } + summary: "Create the Resource for Quantile Streams." +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt new file mode 100644 index 0000000000..ca111af312 --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt @@ -0,0 +1,40 @@ +op { + graph_op_name: "BoostedTreesMakeQuantileSummaries" + visibility: HIDDEN + in_arg { + name: "float_values" + description: <<END +float; List of Rank 2 Tensors each containing values for a single feature. +END + } + in_arg { + name: "example_weights" + description: <<END +float; Rank 1 Tensor with weights per instance. +END + } + in_arg { + name: "epsilon" + description: <<END +float; The required maximum approximation error. +END + } + out_arg { + name: "summaries" + description: <<END +float; List of Rank 2 Tensors each containing the quantile summary (value, weight, +min_rank, max_rank) of a single feature. +END + } + attr { + name: "num_features" + description: <<END +int; Inferred from the size of float_values. +The number of float features. +END + } + summary: "Makes the summary of quantiles for the batch." + description: <<END +An op that takes a list of tensors and outputs the quantile summaries for each tensor. +END +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt new file mode 100644 index 0000000000..bbeecbf32b --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt @@ -0,0 +1,22 @@ +op { + graph_op_name: "BoostedTreesQuantileStreamResourceAddSummaries" + visibility: HIDDEN + in_arg { + name: "quantile_stream_resource_handle" + description: <<END +resource handle referring to a QuantileStreamResource. +END + } + in_arg { + name: "summaries" + description: <<END +string; List of Rank 2 Tensor each containing the summaries for a single feature. +END + } + summary: "Add the quantile summaries to each quantile stream resource." + description: <<END +An op that adds a list of quantile summaries to a quantile stream resource. Each +summary Tensor is rank 2, containing summaries (value, weight, min_rank, max_rank) +for a single feature. +END +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt new file mode 100644 index 0000000000..2fd94efa10 --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt @@ -0,0 +1,31 @@ +op { + graph_op_name: "BoostedTreesQuantileStreamResourceFlush" + visibility: HIDDEN + in_arg { + name: "quantile_stream_resource_handle" + description: <<END +resource handle referring to a QuantileStreamResource. +END + } + in_arg { + name: "num_buckets", + description: <<END +int; approximate number of buckets unless using generate_quantiles. +END + } + attr { + name: "generate_quantiles" + description: <<END +bool; If True, the output will be the num_quantiles for each stream where the ith +entry is the ith quantile of the input with an approximation error of epsilon. +Duplicate values may be present. +If False, the output will be the points in the histogram that we got which roughly +translates to 1/epsilon boundaries and without any duplicates. +Default to False. +END + } + summary: "Flush the summaries for a quantile stream resource." + description: <<END +An op that flushes the summaries for a quantile stream resource. +END +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt new file mode 100644 index 0000000000..206672802f --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt @@ -0,0 +1,27 @@ +op { + graph_op_name: "BoostedTreesQuantileStreamResourceGetBucketBoundaries" + visibility: HIDDEN + in_arg { + name: "quantile_stream_resource_handle" + description: <<END +resource handle referring to a QuantileStreamResource. +END + } + out_arg { + name: "bucket_boundaries" + description: <<END +float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. +END + } + attr { + name: "num_features" + description: <<END +inferred int; number of features to get bucket boundaries for. +END + } + summary: "Generate the bucket boundaries for each feature based on accumulated summaries." + description: <<END +An op that returns a list of float tensors for a quantile stream resource. Each +tensor is Rank 1 containing bucket boundaries for a single feature. +END +} diff --git a/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt new file mode 100644 index 0000000000..cb7786c051 --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt @@ -0,0 +1,5 @@ +op { + graph_op_name: "BoostedTreesQuantileStreamResourceHandleOp" + visibility: HIDDEN + summary: "Creates a handle to a BoostedTreesQuantileStreamResource." +} diff --git a/tensorflow/core/api_def/base_api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt b/tensorflow/core/api_def/base_api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt new file mode 100644 index 0000000000..758eeb96f0 --- /dev/null +++ b/tensorflow/core/api_def/base_api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt @@ -0,0 +1,20 @@ +op { + graph_op_name: "IsBoostedTreesQuantileStreamResourceInitialized" + visibility: HIDDEN + in_arg { + name: "quantile_stream_resource_handle" + description: <<END +resource; The reference to quantile stream resource handle. +END + } + out_arg { + name: "is_initialized" + description: <<END +bool; True if the resource is initialized, False otherwise. +END + } + summary: "Checks whether a quantile stream has been initialized." + description: <<END +An Op that checks if quantile stream resource is initialized. +END +} |