def compute_fde(forecasted_trajectories: NDArrayNumber, gt_trajectory: NDArrayNumber) -> NDArrayFloat:
    'Compute the final displacement error for a set of K predicted trajectories (for the same actor).\n\n    Args:\n        forecasted_trajectories: (K, N, 2) predicted trajectories, each N timestamps in length.\n        gt_trajectory: (N, 2) ground truth trajectory, FDE will be evaluated against true position at index `N-1`.\n\n    Returns:\n        (K,) Final displacement error for each of the predicted trajectories.\n    '
    fde_vector = (forecasted_trajectories - gt_trajectory)[:, (- 1)]
    fde: NDArrayFloat = np.linalg.norm(fde_vector, axis=(- 1))
    return fde
Compute the final displacement error for a set of K predicted trajectories (for the same actor).

Args:
    forecasted_trajectories: (K, N, 2) predicted trajectories, each N timestamps in length.
    gt_trajectory: (N, 2) ground truth trajectory, FDE will be evaluated against true position at index `N-1`.

Returns:
    (K,) Final displacement error for each of the predicted trajectories.
def compute_fde(forecasted_trajectories: NDArrayNumber, gt_trajectory: NDArrayNumber) -> NDArrayFloat:
    'Compute the final displacement error for a set of K predicted trajectories (for the same actor).\n\n    Args:\n        forecasted_trajectories: (K, N, 2) predicted trajectories, each N timestamps in length.\n        gt_trajectory: (N, 2) ground truth trajectory, FDE will be evaluated against true position at index `N-1`.\n\n    Returns:\n        (K,) Final displacement error for each of the predicted trajectories.\n    '
    fde_vector = (forecasted_trajectories - gt_trajectory)[:, (- 1)]
    fde: NDArrayFloat = np.linalg.norm(fde_vector, axis=(- 1))
    return fde