from local

This commit is contained in:
dohe0342 2023-02-14 02:49:22 +09:00
parent 239e697170
commit cfcf26ad17
2 changed files with 6 additions and 1 deletions

View File

@ -175,6 +175,11 @@ class Conformer(Transformer):
x, pos_emb, src_key_padding_mask=mask, warmup=warmup x, pos_emb, src_key_padding_mask=mask, warmup=warmup
) # (S, N, C) ) # (S, N, C)
if self.group_num != 0:
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)
return x, mask return x, mask