Native implementation for pdist, Pearson correlation

I’m trying to calculate the similarity between two activation matrix of two different models following the Teacher Guided Architecture Search paper. My question is, does python has a native implementation of pdist similar to Scipy.spatial.distance.pdist? And a native application for Pearson correlation?

I assume you meant PyTorch, not Python. For pdist see torch.nn.functional.pdist and for Pearson correlation check out this issue.

Thank you!
do you know what metric pytorch for pdist? for example in Scipy.spatial.distance.pdist, you can select between cosine, euclidean, …etc

Check out the docs for available metrics (in that regard pdist in PyTorch is very limited compared to the scipy’s counterpart).