# tf.contrib.training.weighted_resample

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/training/python/training/resample.py#L101-L148) |

Performs an approximate weighted resampling of `inputs`.

    tf.contrib.training.weighted_resample(
        inputs, weights, overall_rate, scope=None, mean_decay=0.999, seed=None
    )

This method chooses elements from `inputs` where each item's rate of
selection is proportional to its value in `weights`, and the average
rate of selection across all inputs (and many invocations!) is
`overall_rate`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `inputs` | A list of tensors whose first dimension is `batch_size`. |
| `weights` | A `[batch_size]`-shaped tensor with each batch member's weight. |
| `overall_rate` | Desired overall rate of resampling. |
| `scope` | Scope to use for the op. |
| `mean_decay` | How quickly to decay the running estimate of the mean weight. |
| `seed` | Random seed. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of tensors exactly like `inputs`, but with an unknown (and possibly zero) first dimension. A tensor containing the effective resampling rate used for each output. ||

<br />