Is the calculation of covariance wrong?such as sigma = np.cov(act, rowvar=False)?
liushanyuan18 opened this issue · comments
Hi
the output of function "get_activations_from_files" is "A numpy array of dimension (num images, 2048) ..." .
That is to say,the "act" is "A numpy array of dimension (num images, 2048) ".
In the formula "sigma = np.cov(act, rowvar=False)",the rowvar is False.
But I think the rowvar should be True because the first dimension of "act" is "num images",so the dimension of "sigma" should be (num images,num images) instead of (2048,2048).
Hi,
to calculate the FID we need the covariance matrix of the activations, therefore, rowvar=False is correct.
Sorry, I still don’t understand , could you please tell me more?
In the numpy.cov source,I found that "rowvar : bool, optional
If rowvar is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.".
In the numpy array of dimension (num images, 2048) , each row represents a variable.
The variables are the activations not the examples (images)
Thank you very much!