Commit 03d0b79e authored by Anthony Larcher's avatar Anthony Larcher
Browse files

merge

parents e120ee8a 3cea5427
...@@ -41,7 +41,6 @@ def hac_iv(diar, scores, method="complete", threshold=0.0): ...@@ -41,7 +41,6 @@ def hac_iv(diar, scores, method="complete", threshold=0.0):
lscores = copy.deepcopy(scores) lscores = copy.deepcopy(scores)
# get the triangular part of the distances # get the triangular part of the distances
distances, t = scores2distance(lscores, threshold) distances, t = scores2distance(lscores, threshold)
# distance = numpy.copy((scores.scoremat + scores.scoremat.T) / 2.0) * -1.0 # distance = numpy.copy((scores.scoremat + scores.scoremat.T) / 2.0) * -1.0
# numpy.fill_diagonal(distance, numpy.inf) # numpy.fill_diagonal(distance, numpy.inf)
# min = numpy.min(distance) # min = numpy.min(distance)
......
...@@ -984,7 +984,7 @@ class Diar(): ...@@ -984,7 +984,7 @@ class Diar():
channel = 'U' channel = 'U'
if diar._attributes.exist('channel'): if diar._attributes.exist('channel'):
channel = segment['channel'] channel = segment['channel']
if time_float: if not time_float:
lst.append('{:s} 1 {:d} {:d} {:s} {:s} {:s} {:s}\n'.format( lst.append('{:s} 1 {:d} {:d} {:s} {:s} {:s} {:s}\n'.format(
segment['show'], segment['start'], segment['stop'] - segment['start'], gender, segment['show'], segment['start'], segment['stop'] - segment['start'], gender,
channel, env, segment['cluster'])) channel, env, segment['cluster']))
......
...@@ -61,7 +61,7 @@ def save_checkpoint(state, is_best, filename='checkpoint.pth.tar', best_filename ...@@ -61,7 +61,7 @@ def save_checkpoint(state, is_best, filename='checkpoint.pth.tar', best_filename
shutil.copyfile(filename, best_filename) shutil.copyfile(filename, best_filename)
class PreNet(nn.Module): class PreNet(nn.Module):
def __init(self, def __init__(self,
sample_rate=16000, sample_rate=16000,
windows_duration=0.2, windows_duration=0.2,
frame_shift=0.01): frame_shift=0.01):
...@@ -153,16 +153,11 @@ class SeqToSeq(nn.Module): ...@@ -153,16 +153,11 @@ class SeqToSeq(nn.Module):
linear_1, linear_1,
linear_2, linear_2,
output_size=1): output_size=1):
"""
:param input_size: super(SeqToSeq, self).__init__()
:param lstm_1: self.preprocessor = PreNet(sample_rate=16000,
:param lstm_2: windows_duration=0.2,
:param linear_1: frame_shift=0.01)
:param linear_2:
:param output_size:
"""
super(BLSTM, self).__init__()
self.lstm_1 = nn.LSTM(input_size, lstm_1 // 2, bidirectional=True, batch_first=True) self.lstm_1 = nn.LSTM(input_size, lstm_1 // 2, bidirectional=True, batch_first=True)
self.lstm_2 = nn.LSTM(lstm_1, lstm_2 // 2, bidirectional=True, batch_first=True) self.lstm_2 = nn.LSTM(lstm_1, lstm_2 // 2, bidirectional=True, batch_first=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment