Skip to content

Commit

Permalink
Fix computation of speaker indexes in unscale_prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
albertaparicio committed Apr 18, 2017
1 parent 5e9f9c5 commit 77a2377
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tfglib/seq2seq_datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import h5py
import numpy as np
from keras.utils.np_utils import to_categorical

from tfglib.construct_table import parse_file
from tfglib.seq2seq_normalize import mask_data
from tfglib.utils import kronecker_delta, sliding_window
Expand Down Expand Up @@ -300,6 +301,7 @@ def seq2seq_build_file_table(self, source_dir, src_index, target_dir,
zero_pad_params(self.max_seq_length, 'trg', trg_eos_flag)
), axis=1)

# TODO Return basename with sequence(s)
return source_params, source_mask, target_params, target_mask

def seq2seq_construct_datatable(self):
Expand Down
4 changes: 1 addition & 3 deletions tfglib/seq2seq_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ def maxmin_scaling(
def unscale_prediction(src_matrix, src_mask, scaled_pred, max_mat, min_mat):
src_masked_data = mask_data(src_matrix, src_mask)

src_spk_index = np.argmax(np.ma.argmax(
src_masked_data[:, 44:54], axis=0, fill_value=0
))
src_spk_index = int(src_masked_data[0, 44])

src_spk_max = max_mat[src_spk_index, :]
src_spk_min = min_mat[src_spk_index, :]
Expand Down

0 comments on commit 77a2377

Please sign in to comment.