from local
This commit is contained in:
parent
16972b56a7
commit
807139dfad
Binary file not shown.
@ -695,8 +695,6 @@ class ConformerEncoder(nn.Module):
|
|||||||
|
|
||||||
outputs = []
|
outputs = []
|
||||||
|
|
||||||
layer_output = []
|
|
||||||
|
|
||||||
for i, mod in enumerate(self.layers):
|
for i, mod in enumerate(self.layers):
|
||||||
output = mod(
|
output = mod(
|
||||||
output,
|
output,
|
||||||
@ -708,11 +706,9 @@ class ConformerEncoder(nn.Module):
|
|||||||
if i in self.aux_layers:
|
if i in self.aux_layers:
|
||||||
outputs.append(output)
|
outputs.append(output)
|
||||||
|
|
||||||
layer_output.append(output)
|
|
||||||
|
|
||||||
output = self.combiner(outputs)
|
output = self.combiner(outputs)
|
||||||
|
|
||||||
return output, layer_output
|
return output
|
||||||
|
|
||||||
@torch.jit.export
|
@torch.jit.export
|
||||||
def chunk_forward(
|
def chunk_forward(
|
||||||
|
|||||||
Binary file not shown.
@ -204,6 +204,7 @@ class Conformer(EncoderInterface):
|
|||||||
x = x.permute(1, 0, 2) # (T, N, C) ->(N, T, C)
|
x = x.permute(1, 0, 2) # (T, N, C) ->(N, T, C)
|
||||||
|
|
||||||
layer_output = [x.permute(1, 0, 2) for x in layer_output]
|
layer_output = [x.permute(1, 0, 2) for x in layer_output]
|
||||||
|
|
||||||
x = self.layer_norm(1/6*(self.sigmoid(self.alpha[0])*layer_output[2] + \
|
x = self.layer_norm(1/6*(self.sigmoid(self.alpha[0])*layer_output[2] + \
|
||||||
self.sigmoid(self.alpha[1])*layer_output[5] + \
|
self.sigmoid(self.alpha[1])*layer_output[5] + \
|
||||||
self.sigmoid(self.alpha[2])*layer_output[8] + \
|
self.sigmoid(self.alpha[2])*layer_output[8] + \
|
||||||
|
|||||||
Reference in New Issue
Block a user