Closed Zhang-O closed 4 years ago
Yes, the probabilities should be computed in multiplication, but log(a*b) = log(a)+log(b), so here I use the log domain to compute.
在 2019年11月18日,下午10:33,Zhang notifications@github.com 写道:
line 72 in translate.py cand_scores = hyp_scores[:, None] - numpy.log((next_p))
I think here should be hyp_scores[:, None] * next_p. The probabilities should be computed in multiplication with time step. Is there anything I overlooked?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JianshuZhang/WAP/issues/27?email_source=notifications&email_token=AETNJULHX66YWAZESJ4FMRDQUKRSTA5CNFSM4JOUM2VKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H2BZLEA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AETNJUPSLNQCXJZ4CRNUWCLQUKRSTANCNFSM4JOUM2VA.
en, it is min( - numpy.log(next_p(t-1)) - numpy.log(next_p(t)) ) = min( -numpy.log(next_p(t-1) next_p(t)) ) =- max( numpy.log(next_p(t-1) next_p(t)) )
thanks!
line 72 in translate.py cand_scores = hyp_scores[:, None] - numpy.log((next_p))
I think here should be hyp_scores[:, None] * next_p. The probabilities should be computed in multiplication with time step. Is there anything I overlooked?