RPA
RPA copied to clipboard
Stretching matrices
Dear Pedro,
Can you explain lines 177, 180, 184 in utils.py?
p = np.sqrt(disp_target / disp_source)
target_pow_train['covs'] = np.stack([powm(covi, 1.0/p) for covi in covs_target_train])
target_pow_test['covs'] = np.stack([powm(covi, 1.0/p) for covi in covs_target_test])
You are taking powers of 1/p instead of p, it seems correct because you are computing p as the fraction of the target over source instead of the source over target as shown in paper eq. 16, but why?
Hi, the goal with the stretching operation is to ensure that the dispersion for target
is the same as that for source
. Of course, I could have done things with p = np.sqrt(dist_source/disp_target)
and then used p
in the powm
operation... it would be simpler and easier to understand. However, it I remember correctly, at the time when I wrote this code, I had other pipelines going on where the inverted-p
operation was more natural. Anyways, it's just a matter of taste in the end :-)