We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I think the following implementation of the Fréchet distance is faster than the current one and would allow to drop the scipy dependency.
scipy
def frechet_distance(mu_x: Tensor, sigma_x: Tensor, mu_y: Tensor, sigma_y: Tensor) -> Tensor: a = (mu_x - mu_y).square().sum(dim=-1) b = sigma_x.trace() + sigma_y.trace() c = torch.linalg.eigvals(sigma_x @ sigma_y).sqrt().real.sum(dim=-1) return a + b - 2 * c
The implementation is based on two facts:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, I think the following implementation of the Fréchet distance is faster than the current one and would allow to drop the
scipy
dependency.The implementation is based on two facts:
The text was updated successfully, but these errors were encountered: