ProbVLM icon indicating copy to clipboard operation
ProbVLM copied to clipboard

Evaluation code

Open asdffasdfaf opened this issue 2 years ago • 2 comments

@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 avatar Dec 21 '23 14:12 asdffasdfaf

@udion @sgk98 Hello?

asdffasdfaf avatar Jan 09 '24 14:01 asdffasdfaf

@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

Pefect96 avatar Mar 27 '24 08:03 Pefect96

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 avatar Oct 28 '24 15:10 udion

the pip list is correct?

Issac304 avatar Mar 22 '25 02:03 Issac304