Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpeechCodebookAnalysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPEECH
SpeechCodebookAnalysis
Commits
23a72754
Commit
23a72754
authored
1 year ago
by
Julian Linke
Browse files
Options
Downloads
Patches
Plain Diff
fontsizes similarity matrix
parent
24a0c493
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
local/plot_pca_similarities.py
+11
-3
11 additions, 3 deletions
local/plot_pca_similarities.py
with
11 additions
and
3 deletions
local/plot_pca_similarities.py
+
11
−
3
View file @
23a72754
...
...
@@ -13,13 +13,14 @@ import faiss
from
mpl_toolkits.mplot3d
import
Axes3D
import
matplotlib.patches
as
patches
# List of predefined colors for each corpus (you can add more if
you like
)
# List of predefined colors for each corpus (you can add more if
necessary
)
colors
=
[
'
tab:red
'
,
'
tab:blue
'
,
'
tab:green
'
,
'
tab:orange
'
,
'
tab:purple
'
,
'
tab:brown
'
,
'
tab:pink
'
,
'
tab:gray
'
,
'
tab:olive
'
,
'
tab:cyan
'
]
# markersize
# fontsize and markersize
MS
=
30
def
main
(
X_path
,
y_path
,
pcaA_path
,
pcab_path
,
out_path
,
json_path
):
...
...
@@ -40,10 +41,17 @@ def main(X_path, y_path, pcaA_path, pcab_path, out_path, json_path):
labels
=
list
(
spks
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
15
,
15
))
cax
=
ax
.
matshow
(
X
,
interpolation
=
'
nearest
'
)
# x-ticks fontsize
for
label
in
ax
.
get_xticklabels
():
label
.
set_fontsize
(
25
)
# y-ticks fontsize
for
label
in
ax
.
get_yticklabels
():
label
.
set_fontsize
(
25
)
ax
.
grid
()
plt
.
xticks
(
range
(
len
(
labels
)),
labels
,
rotation
=
90
);
plt
.
yticks
(
range
(
len
(
labels
)),
labels
);
fig
.
colorbar
(
cax
,
ticks
=
[
0.1
,
0.2
,
0.3
,
0.4
,
0.5
,
0.6
,
0.7
,
.
8
,
.
9
,
1
])
cbar
=
fig
.
colorbar
(
cax
,
ticks
=
[
0.1
,
0.2
,
0.3
,
0.4
,
0.5
,
0.6
,
0.7
,
.
8
,
.
9
,
1
])
cbar
.
ax
.
tick_params
(
labelsize
=
25
)
fig_path
=
os
.
path
.
join
(
out_path
,
'
{}.png
'
.
format
(
X_path
.
split
(
'
/
'
)[
-
1
].
replace
(
'
.npy
'
,
''
)))
print
(
'
\n
save similarity matrix to {}
'
.
format
(
fig_path
))
plt
.
savefig
(
fig_path
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment