(self, beam, attn)
Function to update scores of a Beam that is not finished
Function to update scores of a Beam that is not finished
Function to update scores of a Beam that is not finished
def update_score(self, beam, attn):
        """
        Function to update scores of a Beam that is not finished
        """
        if "prev_penalty" in beam.global_state.keys():
            beam.scores.add_(beam.global_state["prev_penalty"])
            penalty = self.cov_penalty(beam,
                                       beam.global_state["coverage"] + attn,
                                       self.beta)
            beam.scores.sub_(penalty)
def update_score ( self , beam , attn ) : if "prev_penalty" in beam . global_state . keys ( ) : beam . scores . add_ ( beam . global_state [ "prev_penalty" ] ) penalty = self . cov_penalty ( beam , beam . global_state [ "coverage" ] + attn , self . beta ) beam . scores . sub_ ( penalty )