wtf is gamma supposed to represent here? [code]
- User
wtf is gamma supposed to represent here?
def rnnt_loss(am, lm, z_q_lens, txt_pd, txt_lens, blank): am_pd = R.pad_sequence(torch.split(am.float(), z_q_lens.tolist()), batch_first=True) lm_pd = R.pad_sequence(torch.split(lm.float(), txt_lens.tolist()), batch_first=True) boundary = torch.zeros((am_pd.shape[0], 4), dtype=torch.int64, device=am.device) boundary[:, 2] = txt_lens - 1 # NOTE: we assume -1 here boundary[:, 3] = z_q_lens loss, (px, _), (px_grad, _) = fast_rnnt.rnnt_loss_simple( lm=lm_pd, # [B, S+1, V] am=am_pd, # [B, T, V] symbols=txt_pd, # [B, S] (NOTE: we assume no BOS here) termination_symbol=blank, boundary=boundary, reduction="sum", return_prob=True, return_grad=True, ) gamma = px.exp() - px_grad # [B, S, T] return loss, gamma Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.