Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor update re: np.arccos #382

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"\n",
" rdms_comp = rsatoolbox.rdm.compare(rdms, rdms, method=rdm_comp_method)\n",
" if rdm_comp_method == 'cosine':\n",
" rdms_comp = 1 - rdms_comp\n",
" rdms_comp = np.arccos(rdms_comp)\n",
" rdms_comp = np.nan_to_num(rdms_comp, nan=0.0)\n",
"\n",
" # Symmetrize\n",
Expand Down Expand Up @@ -1244,9 +1244,7 @@
"\n",
"$$\\hat M(\\text{layer i}, \\text{image j x image k})$$\n",
"\n",
"We can then calculate the distances between the different rows of this new matrix. This new measure captures the distances between representational geometries of different layers. So we are now creating an RDM matrix of the RDM matrices!\n",
"\n",
"We compute the similarity between geometries using the cosine dissimilarity. The resulting matrix has the dimensions of `#layers` by `#layers`.\n",
"We can then calculate the cosine similarity between the different rows of this new matrix. By taking the arccos of this measure, we obtain a proper distance between representational geometries of different layers (Williams et al. 2021). So we are now creating an RDM matrix of the RDM matrices! The resulting matrix has the dimensions of `#layers` by `#layers`.\n",
"\n",
"The last step to visualize the path is to embed the distances between the geometries in a lower dimensional space. We use MDS to reduce the dimensions to 2 in order to show each computational step as a point in a 2D space."
]
Expand Down Expand Up @@ -1984,7 +1982,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.8.17"
}
},
"nbformat": 4,
Expand Down
Loading