tfg.math.interpolation.bspline.knot_weights
Stay organized with collections
Save and categorize content based on your preferences.
Function that converts cardinal B-spline positions to knot weights.
tfg.math.interpolation.bspline.knot_weights(
positions: type_alias.TensorLike,
num_knots: type_alias.TensorLike,
degree: int,
cyclical: bool,
sparse_mode: bool = False,
name: str = 'bspline_knot_weights'
) -> Union[tf.Tensor, Tuple[tf.Tensor, tf.Tensor]]
Note |
In the following, A1 to An are optional batch dimensions.
|
Args |
positions
|
A tensor with shape [A1, .. An] . Positions must be between
[0, C - D) for non-cyclical and [0, C) for cyclical splines, where C
is the number of knots and D is the spline degree.
|
num_knots
|
A strictly positive int describing the number of knots in the
spline.
|
degree
|
An int describing the degree of the spline, which must be smaller
than num_knots .
|
cyclical
|
A bool describing whether the spline is cyclical.
|
sparse_mode
|
A bool describing whether to return a result only for the
knots with nonzero weights. If set to True, the function returns the
weights of only the degree + 1 knots that are non-zero, as well as the
indices of the knots.
|
name
|
A name for this op. Defaults to "bspline_knot_weights".
|
Returns |
A tensor with dense weights for each control point, with the shape
[A1, ... An, C] if sparse_mode is False.
Otherwise, returns a tensor of shape [A1, ... An, D + 1] that contains the
non-zero weights, and a tensor with the indices of the knots, with the type
tf.int32.
|
Raises |
ValueError
|
If degree is greater than 4 or num_knots - 1, or less than 0.
|
InvalidArgumentError
|
If positions are not in the right range.
|
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.
Last updated 2022-10-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-10-28 UTC."],[],[]]