Fix of issue #23
This commit is contained in:
parent
ea38c68344
commit
26035f3626
5775
DeepSpeech.ipynb
5775
DeepSpeech.ipynb
File diff suppressed because it is too large
Load Diff
BIN
images/Parallelism.png
Normal file
BIN
images/Parallelism.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
@ -22,7 +22,7 @@ def audiofiles_to_audio_data_sets(audio_filenames, numcep, numcontext):
|
|||||||
# - numcep dimensions for the current mfcc feature set
|
# - numcep dimensions for the current mfcc feature set
|
||||||
# - numcontext*numcep dimensions for each of the past and future (x2) mfcc feature set
|
# - numcontext*numcep dimensions for each of the past and future (x2) mfcc feature set
|
||||||
# => so numcep + 2*numcontext*numcep
|
# => so numcep + 2*numcontext*numcep
|
||||||
train_inputs = np.array([], np.float)
|
train_inputs = np.array([], np.float32)
|
||||||
train_inputs.resize((orig_inputs.shape[0], numcep + 2*numcep*numcontext))
|
train_inputs.resize((orig_inputs.shape[0], numcep + 2*numcep*numcontext))
|
||||||
|
|
||||||
# Prepare pre-fix post fix context (TODO: Fill empty_mfcc with MCFF of silence)
|
# Prepare pre-fix post fix context (TODO: Fill empty_mfcc with MCFF of silence)
|
||||||
|
5
util/gpu/__init__.py
Normal file
5
util/gpu/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from tensorflow.python.client import device_lib
|
||||||
|
|
||||||
|
def get_available_gpus():
|
||||||
|
local_device_protos = device_lib.list_local_devices()
|
||||||
|
return [x.name for x in local_device_protos if x.device_type == 'GPU']
|
@ -1,4 +1,5 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
import tensorflow as tf
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
SPACE_TOKEN = '<space>'
|
SPACE_TOKEN = '<space>'
|
||||||
@ -47,4 +48,4 @@ def sparse_tuple_from(sequences, dtype=np.int32):
|
|||||||
values = np.asarray(values, dtype=dtype)
|
values = np.asarray(values, dtype=dtype)
|
||||||
shape = np.asarray([len(sequences), np.asarray(indices).max(0)[1]+1], dtype=np.int64)
|
shape = np.asarray([len(sequences), np.asarray(indices).max(0)[1]+1], dtype=np.int64)
|
||||||
|
|
||||||
return indices, values, shape
|
return tf.SparseTensor(indices=indices, values=values, shape=shape)
|
||||||
|
Loading…
Reference in New Issue
Block a user