diff --git a/egs/librispeech/ASR/.conv_feat_vis.py.swp b/egs/librispeech/ASR/.conv_feat_vis.py.swp index a180021c6..bcc903d37 100644 Binary files a/egs/librispeech/ASR/.conv_feat_vis.py.swp and b/egs/librispeech/ASR/.conv_feat_vis.py.swp differ diff --git a/egs/librispeech/ASR/conv_feat_vis.py b/egs/librispeech/ASR/conv_feat_vis.py index 68b5b665a..efe5a9d87 100644 --- a/egs/librispeech/ASR/conv_feat_vis.py +++ b/egs/librispeech/ASR/conv_feat_vis.py @@ -2,25 +2,27 @@ from glob import glob import numpy as np import matplotlib.pyplot as plt -feats = [] -feat_list = glob('./conv_feat/*.npy') -for feat in feat_list: - feat = np.load(feat) - feats.append(feat) +spk_list = glob('./conv_feat/*') +for spk in spk_list: + feats = [] + feat_list = glob(f'{spk}/*.npy') + for feat in feat_list: + feat = np.load(feat) + feats.append(feat) -feats_all = feats[0] -for feat in feats: - feats_all = np.concatenate([feats_all, feat]) + feats_all = feats[0] + for feat in feats: + feats_all = np.concatenate([feats_all, feat]) -feats_all = feats_all.transpose(1,0) + feats_all = feats_all.transpose(1,0) -for i in range(512): - mean = feats_all[i].mean() - std = feats_all[i].std() - print(mean, std) -''' -for i in range(512): - plt.hist(feats_all[i], bins=500) - plt.savefig(f'./conv_feat/dim_{i}.pdf') - plt.close() -''' + for i in range(512): + mean = feats_all[i].mean() + std = feats_all[i].std() + print(mean, std) + ''' + for i in range(512): + plt.hist(feats_all[i], bins=500) + plt.savefig(f'./conv_feat/dim_{i}.pdf') + plt.close() + '''