966436403e5e927e3e7d5b389dad6ef06aaa7e03,tests/test_sequence_generator.py,TestSequeneceGenerator,test_without_normalization,#TestSequeneceGenerator#,210

Before Change


        generator = SequenceGenerator(
            [self.model], self.tgt_dict, beam_size=2, normalize_scores=False
        )
        hypos = generator.forward(self.sample)
        eos, w1, w2 = self.tgt_dict.eos(), self.w1, self.w2
        // sentence 1, beam 1
        self.assertHypoTokens(hypos[0][0], [w1, eos])
        self.assertHypoScore(hypos[0][0], [0.9, 1.0], normalized=False)

After Change


    def test_without_normalization(self):
        // Sentence 1: unchanged from the normalized case
        // Sentence 2: beams swap order
        generator = SequenceGenerator(self.tgt_dict, beam_size=2, normalize_scores=False)
        hypos = generator.generate([self.model], self.sample)
        eos, w1, w2 = self.tgt_dict.eos(), self.w1, self.w2
        // sentence 1, beam 1
        self.assertHypoTokens(hypos[0][0], [w1, eos])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 14

Non-data size: 4

Instances


Project Name: elbayadm/attn2d
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestSequeneceGenerator
Method Name: test_without_normalization


Project Name: pytorch/fairseq
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestDiverseBeamSearch
Method Name: test_diverse_beam_search


Project Name: elbayadm/attn2d
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestTopPSamplingSearch
Method Name: test_topp_sampling_search_high_prob


Project Name: pytorch/fairseq
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestSequeneceGenerator
Method Name: test_with_lenpen_favoring_long_hypos


Project Name: elbayadm/attn2d
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestDiverseSiblingsSearch
Method Name: test_diverse_beam_search


Project Name: elbayadm/attn2d
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestTopPSamplingSearch
Method Name: test_topp_sampling_search_low_prob


Project Name: pytorch/fairseq
Commit Name: 966436403e5e927e3e7d5b389dad6ef06aaa7e03
Time: 2020-04-07
Author: akyrola@fb.com
File Name: tests/test_sequence_generator.py
Class Name: TestSequeneceGenerator
Method Name: test_with_lenpen_favoring_short_hypos