contrib.data.rejection_resample
tf.contrib.data.rejection_resample
tf.contrib.data.rejection_resample
rejection_resample( dataset, class_func, target_dist, initial_dist=None, seed=None )
Defined in tensorflow/contrib/data/python/ops/dataset_ops.py
.
Resamples this dataset to achieve a target class distribution.
NOTE Resampling is performed via rejection sampling; some fraction of the input values will be dropped.
Args:
-
dataset
: ADataset
object. -
class_func
: A function mapping a nested structure of tensors (having shapes and types defined bydataset.output_shapes
anddataset.output_types
) to a scalartf.int32
tensor. Values should be in[0, num_classes)
. -
target_dist
: A floating point type tensor, shaped `[num_classes]. -
initial_dist
: (Optional.) A floating point type tensor, shaped[num_classes]
. If not provided, the true class distribution is estimated live in a streaming fashion. -
seed
: (Optional.) Python integer seed for the resampler.
Returns:
A Dataset
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/data/rejection_resample