b56a4b355dfc302fa449d223e065af3a7acac986,snorkel/learning/pytorch/noise_aware_model.py,TorchNoiseAwareModel,load,#TorchNoiseAwareModel#Any#Any#Any#,252

Before Change


        model_dir = os.path.join(save_dir, model_name)

        // Load model kwargs needed to rebuild model
        with open(os.path.join(model_dir, "model_kwargs.pkl"), "rb") as f:
            model_kwargs = load(f)
        
        // Create new graph, build network, and start session
        self._build_new_graph_session(**model_kwargs)

        // Initialize variables
        with self.graph.as_default():

After Change


        warnings.warn("Unstable! Please extensively test this part of the code when time permits")
        
        self.load_state_dict(
            torch.load("{}/model.params".format(model_dir))
        )
        if verbose:
            print("[{0}] Loaded model <{1}>".format(self.name, model_name))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: snorkel-team/snorkel
Commit Name: b56a4b355dfc302fa449d223e065af3a7acac986
Time: 2018-05-03
Author: dnicholson329@gmail.com
File Name: snorkel/learning/pytorch/noise_aware_model.py
Class Name: TorchNoiseAwareModel
Method Name: load


Project Name: pantsbuild/pants
Commit Name: 0f80c70a2bdaffbf4b1797aea481a62641701e93
Time: 2018-10-14
Author: benjyw@gmail.com
File Name: src/python/pants/releases/reversion.py
Class Name:
Method Name: reversion


Project Name: studioml/studio
Commit Name: bb6b2d059ad7b8a231d9f8015b41e60f033eaf76
Time: 2017-08-04
Author: peter.zhokhov@sentient.ai
File Name: studio/model.py
Class Name:
Method Name: get_config