tf.keras.ops.vander

Generate a Vandermonde matrix.

x 1D input tensor.
N Number of columns. If None, N = len(x).
increasing Order of powers. If True, powers increase left to right.

Output tensor, Vandermonde matrix of shape (len(x), N).

Example:

import numpy as np
import keras
x = np.array([1, 2, 3, 5])
keras.ops.vander(x)
array([[  1,   1,   1,   1],
       [  8,   4,   2,   1],
       [ 27,   9,   3,   1],
       [125,  25,   5,   1]])