def compute_ade(forecasted_trajectories: NDArrayNumber, gt_trajectory: NDArrayNumber) -> NDArrayFloat:
    'Compute the average 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.\n\n    Returns:\n        (K,) Average displacement error for each of the predicted trajectories.\n    '
    displacement_errors = np.linalg.norm((forecasted_trajectories - gt_trajectory), axis=2)
    ade: NDArrayFloat = np.mean(displacement_errors, axis=1)
    return ade
Compute the average 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.

Returns:
    (K,) Average displacement error for each of the predicted trajectories.
def compute_ade(forecasted_trajectories: NDArrayNumber, gt_trajectory: NDArrayNumber) -> NDArrayFloat:
    'Compute the average 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.\n\n    Returns:\n        (K,) Average displacement error for each of the predicted trajectories.\n    '
    displacement_errors = np.linalg.norm((forecasted_trajectories - gt_trajectory), axis=2)
    ade: NDArrayFloat = np.mean(displacement_errors, axis=1)
    return ade