Fix of issue #23

This commit is contained in:
Kelly Davis 2016-09-23 12:19:43 +02:00
parent ea38c68344
commit 26035f3626
5 changed files with 462 additions and 5327 deletions

File diff suppressed because it is too large Load Diff

BIN
images/Parallelism.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@ -22,7 +22,7 @@ def audiofiles_to_audio_data_sets(audio_filenames, numcep, numcontext):
# - numcep dimensions for the current mfcc feature set
# - numcontext*numcep dimensions for each of the past and future (x2) mfcc feature set
# => 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))
# Prepare pre-fix post fix context (TODO: Fill empty_mfcc with MCFF of silence)

5
util/gpu/__init__.py Normal file
View 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']

View File

@ -1,4 +1,5 @@
import numpy as np
import tensorflow as tf
# Constants
SPACE_TOKEN = '<space>'
@ -47,4 +48,4 @@ def sparse_tuple_from(sequences, dtype=np.int32):
values = np.asarray(values, dtype=dtype)
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)