Skip to content

Commit 0b06946

Browse files
author
josh
committed
viz
1 parent 6722aab commit 0b06946

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

DeepSpeech.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# -*- coding: utf-8 -*-
33
from __future__ import absolute_import, division, print_function
44

5+
import matplotlib.pyplot as plt
6+
from matplotlib.colors import LogNorm
57
import os
68
import sys
79

@@ -871,8 +873,20 @@ def do_single_file_inference(input_file_path):
871873
inputs['input_lengths']: [num_strides],
872874
})
873875

876+
# np.set_printoptions(threshold=np.nan)
877+
# print(logits.size)
878+
# print(logits[0].size)
879+
# print(logits[5])
874880
logits = np.squeeze(logits)
875-
881+
print(logits.shape)
882+
print(logits.T.shape)
883+
plt.pcolor(logits.T, norm=LogNorm(vmin=logits.min(),vmax=logits.max()))
884+
plt.title('Log Normalized Logits from German Model for clip: "das ist ganz schön"', fontsize=20)
885+
plt.xlabel('Length of Audio Clip', fontsize=18)
886+
plt.ylabel('Index of UTF-8 Byte', fontsize=16)
887+
plt.colorbar()
888+
plt.show()
889+
876890
scorer = Scorer(FLAGS.lm_alpha, FLAGS.lm_beta,
877891
FLAGS.lm_binary_path, FLAGS.lm_trie_path,
878892
Config.alphabet)

0 commit comments

Comments
 (0)