857e36921ab5ca51c919839ec0b6e87585160d0c,onmt/decoders/ensemble.py,,load_test_model,#Any#Any#,119

Before Change


        if shared_fields is None:
            shared_fields = fields
        else:
            for key, field in fields.items():
                if field is not None and "vocab" in field.__dict__:
                    assert field.vocab.stoi == shared_fields[key].vocab.stoi, \
                        "Ensemble models must use the same preprocessed data"
        models.append(model)
        if shared_model_opt is None:
            shared_model_opt = model_opt
    ensemble_model = EnsembleModel(models, opt.avg_raw_probs)

After Change



    def init_state(self, src, memory_bank, enc_hidden):
         See :obj:`RNNDecoderBase.init_state()` 
        for i, model_decoder in enumerate(self.model_decoders):
            model_decoder.init_state(src, memory_bank[i], enc_hidden[i])

    def map_state(self, fn):
        for model_decoder in self.model_decoders:
            model_decoder.map_state(fn)


class EnsembleGenerator(nn.Module):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 857e36921ab5ca51c919839ec0b6e87585160d0c
Time: 2019-02-14
Author: dylan.flaute@gmail.com
File Name: onmt/decoders/ensemble.py
Class Name:
Method Name: load_test_model


Project Name: nipy/dipy
Commit Name: 2df29df88d4b603b0e89e45481a062c38d4b829d
Time: 2017-03-28
Author: marc.cote.19@gmail.com
File Name: dipy/viz/tests/test_ui.py
Class Name:
Method Name: test_ui_textbox


Project Name: facebookresearch/Horizon
Commit Name: 45496de13b7932d8ec860da06f14d113000803be
Time: 2018-08-29
Author: jjg@fb.com
File Name: ml/rl/test/gridworld/test_gridworld_pytorch.py
Class Name: TestGridworld
Method Name: test_reward_boost