Skip to content
New issue

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

Dummy example gives non intuitive result #7

Open
ashual opened this issue May 31, 2021 · 0 comments
Open

Dummy example gives non intuitive result #7

ashual opened this issue May 31, 2021 · 0 comments

Comments

@ashual
Copy link

ashual commented May 31, 2021

Hello and thank you for this great paper and implementation.

I've run your method with a dummy example:

    fake_features = torch.ones((1024, 4096))
    real_features = torch.ones((1024, 4096))

and would expect 1.0 for both density and coverage but actually got 0.0

There are two changes to the Density metric that might help

  1. Add less or equal
    (distance_real_fake < np.expand_dims(real_nearest_neighbour_distances, axis=1)
    =>
    (distance_real_fake <= np.expand_dims(real_nearest_neighbour_distances, axis=1)
  2. Add clamp with self.neareset_k and enforce [0,1] result
    (distance_real_fake <= real_nearest_neighbour_distances.unsqueeze(1)).sum(dim=0) => (distance_real_fake <= real_nearest_neighbour_distances.unsqueeze(1)).sum(dim=0).clamp(0, self.nearest_k)

Is it make sense or do I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant