b56a4b355dfc302fa449d223e065af3a7acac986,snorkel/learning/pytorch/noise_aware_model.py,TorchNoiseAwareModel,load,#TorchNoiseAwareModel#,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

After Change


        Load model from file and rebuild in new graph / session.
        model_name = model_name or self.name
        model_dir = os.path.join(save_dir, model_name)
        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))
        )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: 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: save


Project Name: pysb/pysb
Commit Name: 8c4162c3666a2b238b2b60c3f94bb8102c4ef6cf
Time: 2016-04-05
Author: bachmanjohn@gmail.com
File Name: pysb/kappa.py
Class Name:
Method Name: set_kappa_path