diff options
author | Alex Auvolat <alex@adnab.me> | 2015-12-21 10:34:16 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-12-21 10:34:16 +0100 |
commit | 84f6dc7e109d822aa6bd5440b7a650c98ab69edb (patch) | |
tree | 3730c087dfc7a933f4a37ea39801c15e69ba811b | |
parent | b543ac7f330fa7b9f1400d76d1720aba1e550d6c (diff) | |
download | pgm-ctc-84f6dc7e109d822aa6bd5440b7a650c98ab69edb.tar.gz pgm-ctc-84f6dc7e109d822aa6bd5440b7a650c98ab69edb.zip |
minifix
-rw-r--r-- | ctc.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -34,7 +34,7 @@ class CTC(Brick): l_blk = tensor.zeros((S, B)) l_blk = tensor.set_subtensor(l_blk[1::2,:],l) - # dimension of alpha : + # dimension of alpha (corresponds to alpha hat in the paper) : # T x B x S # dimension of c : # T x B @@ -44,7 +44,8 @@ class CTC(Brick): probs[0][tensor.arange(B), l[0]], tensor.zeros((B, S-2)) ], axis=1) - c0 = alpha0.sum(axis=2) + c0 = alpha0.sum(axis=1) + alpha0 = alpha0 / c0[:,None] # recursion def recursion(p, p_mask, prev_alpha, prev_c): |