cfeaturecs = random_fourier_features_gpu(cfeaturec, num_f=num_f, sum=sum).cuda()
I think this cfeaturecs has shape of [B, D, H_rff], where B is batch size, D is number of features, and H_rff is size of RFF space.
However, the later for loop
for i in range(cfeaturecs.size()[-1]):
cfeaturec = cfeaturecs[:, :, i]
cov1 = cov(cfeaturec, weight)
The cfeaturec now is [B, D]. The last dimension is omitted. This does not correspond to the original equation, where the partial corss-covariance is calculated in the RFF space.
I think this
cfeaturecshas shape of [B, D, H_rff], where B is batch size, D is number of features, and H_rff is size of RFF space.However, the later for loop
The
cfeaturecnow is [B, D]. The last dimension is omitted. This does not correspond to the original equation, where the partial corss-covariance is calculated in the RFF space.