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

Evaluation code #4

Closed
asdffasdfaf opened this issue Dec 21, 2023 · 3 comments
Closed

Evaluation code #4

asdffasdfaf opened this issue Dec 21, 2023 · 3 comments

Comments

@asdffasdfaf
Copy link

@udion @sgk98 Thank you. Could you provide the evaluation code, please?

Is the following code for calculating uncertainty correct?

def mean(tensor):
    log_tensor = torch.log(tensor)
    mean_log = torch.mean(log_tensor)
    geometric_mean = torch.exp(mean_log)
    return geometric_mean.item()

imdict=get_features_uncer_ProbVLM(CLIP_Net,ProbVLM_Net,cub_test_loader)
uncertainty=imdict['i_u']
uncertainty=[mean(i) for i in uncertainty]

The mean() function calculates the geometric mean.

@asdffasdfaf
Copy link
Author

asdffasdfaf commented Jan 9, 2024

@udion @sgk98 Hello?

@Pefect96
Copy link

@asdffasdfaf Have you solved the problem? In the function of get_features_uncer_ProbVLM, I do not find the specific definition for the function multi_fwpass_BayesCap

@udion
Copy link
Collaborator

udion commented Oct 28, 2024

It is a function that computes the variance (or uncertainty) with the alpha, beta predictions from the network as mentioned in Eq. 9 in paper.

The aleatoric uncertainty can be computed by the formula of variance mentioned here: https://en.wikipedia.org/wiki/Generalized_normal_distribution

I think we forgot to update that function, both of us have graduated now, so can't update the code, but the above function should be straight forward to write.

@udion udion closed this as completed Oct 28, 2024
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

3 participants