(self, beam, logprobs, alpha=0.)
return logprobs / len(beam.next_ys)
Returns the average probability of tokens in a sequence.
Returns the average probability of tokens in a sequence.
Returns the average probability of tokens in a sequence .
def length_average(self, beam, logprobs, alpha=0.):
        """
        Returns the average probability of tokens in a sequence.
        """
        return logprobs / len(beam.next_ys)
def length_average ( self , beam , logprobs , alpha = 0. ) : return logprobs / len ( beam . next_ys )