mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
from local
This commit is contained in:
parent
7863c82966
commit
71cbd39280
Binary file not shown.
@ -214,6 +214,7 @@ class Conformer(EncoderInterface):
|
||||
x = x.permute(1, 0, 2) # (T, N, C) ->(N, T, C)
|
||||
|
||||
layer_outputs = [x.permute(1, 0, 2) for x in layer_outputs]
|
||||
'''
|
||||
if self.group_num == 4:
|
||||
x = self.layer_norm(1/4*(self.sigmoid(self.alpha[0])*layer_outputs[2] + \
|
||||
self.sigmoid(self.alpha[1])*layer_outputs[5] + \
|
||||
@ -247,6 +248,11 @@ class Conformer(EncoderInterface):
|
||||
)
|
||||
)
|
||||
'''
|
||||
x = 0
|
||||
for enum, alpha in enumerate(self.alpha):
|
||||
x += self.sigmoid(alpha) * layer_outputs[(enum+1)*self.group_layer_num-1]
|
||||
x = self.layer_norm(x/self.group_num)
|
||||
'''
|
||||
layer_outputs = [x.permute(1, 0, 2) for x in layer_outputs]
|
||||
|
||||
x = 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user