Interpolates vectors by taking their weighted sum.
tfg.math.interpolation.slerp.interpolate_with_weights(
vector1: type_alias.TensorLike,
vector2: type_alias.TensorLike,
weight1: Union[type_alias.Float, type_alias.TensorLike],
weight2: Union[type_alias.Float, type_alias.TensorLike],
name: str = 'interpolate_with_weights'
) -> tf.Tensor
Interpolation for all variants of slerp is a simple weighted sum over inputs.
Therefore this function simply returns weight1 * vector1 + weight2 * vector2.
Note |
In the following, A1 to An are optional batch dimensions.
|
Args |
vector1
|
A tensor of shape [A1, ... , An, M] , which stores a normalized
vector in its last dimension.
|
vector2
|
A tensor of shape [A1, ... , An, M] , which stores a normalized
vector in its last dimension.
|
weight1
|
A float or a tensor describing weights for the vector1 and with
a shape broadcastable to the shape of the input vectors.
|
weight2
|
A float or a tensor describing weights for the vector2 and with
a shape broadcastable to the shape of the input vectors.
|
name
|
A name for this op. Defaults to "interpolate_with_weights".
|
Returns |
A tensor of shape [A1, ... , An, M] containing the result of the
interpolation.
|