tfm.vision.preprocess_ops_3d.sample_linspace_sequence
Stay organized with collections
Save and categorize content based on your preferences.
Samples num_windows
segments from sequence with linearly spaced offsets.
tfm.vision.preprocess_ops_3d.sample_linspace_sequence(
sequence: tf.Tensor, num_windows: int, num_steps: int, stride: int
) -> tf.Tensor
The samples are concatenated in a single tf.Tensor
in order to have the same
format structure per timestep (e.g. a single frame). If num_steps
* stride
is bigger than the number of timesteps, the sequence is repeated. This
function can be used in evaluation in order to extract enough segments to span
the entire sequence.
Args |
sequence
|
Any tensor where the first dimension is timesteps.
|
num_windows
|
Number of windows retrieved from the sequence.
|
num_steps
|
Number of steps (e.g. frames) to take.
|
stride
|
Distance to sample between timesteps.
|
Returns |
A single tf.Tensor with first dimension num_windows * num_steps . The
tensor contains the concatenated list of num_windows tensors which offsets
have been linearly spaced from input.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[null,null,["Last updated 2024-02-02 UTC."],[],[],null,["# tfm.vision.preprocess_ops_3d.sample_linspace_sequence\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/models/blob/v2.15.0/official/vision/ops/preprocess_ops_3d.py#L38-L75) |\n\nSamples `num_windows` segments from sequence with linearly spaced offsets. \n\n tfm.vision.preprocess_ops_3d.sample_linspace_sequence(\n sequence: tf.Tensor, num_windows: int, num_steps: int, stride: int\n ) -\u003e tf.Tensor\n\nThe samples are concatenated in a single [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) in order to have the same\nformat structure per timestep (e.g. a single frame). If `num_steps` \\* `stride`\nis bigger than the number of timesteps, the sequence is repeated. This\nfunction can be used in evaluation in order to extract enough segments to span\nthe entire sequence.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|----------------------------------------------------|\n| `sequence` | Any tensor where the first dimension is timesteps. |\n| `num_windows` | Number of windows retrieved from the sequence. |\n| `num_steps` | Number of steps (e.g. frames) to take. |\n| `stride` | Distance to sample between timesteps. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A single [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) with first dimension `num_windows` \\* `num_steps`. The tensor contains the concatenated list of `num_windows` tensors which offsets have been linearly spaced from input. ||\n\n\u003cbr /\u003e"]]