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: A Dataset object.
  • class_func: A function mapping a nested structure of tensors (having shapes and types defined by dataset.output_shapes and dataset.output_types) to a scalar tf.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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部