tfl.pwl_calibration_lib.compute_interpolation_weights

View source on GitHub

Computes weights for PWL calibration.

inputs Tensor of shape: (D0, D1, ..., DN, 1) which represents inputs to to the pwl function. A typical shape is: (batch_size, 1).
keypoints Rank-1 tensor of shape (num_keypoints - 1) which represents left keypoint of pieces of piecewise linear function along X axis.
lengths Rank-1 tensor of shape (num_keypoints - 1) which represents lengths of pieces of piecewise linear function along X axis.

Interpolation weights tensor of shape: (D0, D1, ..., DN, num_keypoints).