Merge branch 'k2-fsa:master' into multi

This commit is contained in:
Yifan Yang 2023-06-15 17:53:19 +08:00 committed by GitHub
commit 33a8bf54be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 4 deletions

View File

@ -58,7 +58,6 @@ class Decoder(nn.Module):
self.embedding = nn.Embedding( self.embedding = nn.Embedding(
num_embeddings=vocab_size, num_embeddings=vocab_size,
embedding_dim=decoder_dim, embedding_dim=decoder_dim,
padding_idx=blank_id,
) )
# the balancers are to avoid any drift in the magnitude of the # the balancers are to avoid any drift in the magnitude of the
# embeddings, which would interact badly with parameter averaging. # embeddings, which would interact badly with parameter averaging.

View File

@ -333,7 +333,7 @@ class AsrModel(nn.Module):
simple_loss, pruned_loss = self.forward_transducer( simple_loss, pruned_loss = self.forward_transducer(
encoder_out=encoder_out, encoder_out=encoder_out,
encoder_out_lens=encoder_out_lens, encoder_out_lens=encoder_out_lens,
y=y, y=y.to(x.device),
y_lens=y_lens, y_lens=y_lens,
prune_range=prune_range, prune_range=prune_range,
am_scale=am_scale, am_scale=am_scale,

View File

@ -789,7 +789,7 @@ def compute_loss(
texts = batch["supervisions"]["text"] texts = batch["supervisions"]["text"]
y = sp.encode(texts, out_type=int) y = sp.encode(texts, out_type=int)
y = k2.RaggedTensor(y).to(device) y = k2.RaggedTensor(y)
with torch.set_grad_enabled(is_training): with torch.set_grad_enabled(is_training):
simple_loss, pruned_loss, ctc_loss = model( simple_loss, pruned_loss, ctc_loss = model(

View File

@ -2190,7 +2190,7 @@ class ConvolutionModule(nn.Module):
x = self.in_proj(x) # (time, batch, 2*channels) x = self.in_proj(x) # (time, batch, 2*channels)
x, s = x.chunk(2, dim=-1) x, s = x.chunk(2, dim=2)
s = self.sigmoid(s) s = self.sigmoid(s)
x = x * s x = x * s
# (time, batch, channels) # (time, batch, channels)