tfg.math.interpolation.slerp.interpolate_with_weights

Interpolates vectors by taking their weighted sum.

tfg.math.interpolation.slerp.interpolate_with_weights(
    vector1,
    vector2,
    weight1,
    weight2,
    name=None
)

Defined in math/interpolation/slerp.py.

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.