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

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: daavoo/pyntcloud
Commit Name: cdbe12c9ecc86fb54e6310d6aeab98edc6eba879
Time: 2017-05-02
Author: daviddelaiglesiacastro@gmail.com
File Name: pyntcloud/plot/points.py
Class Name:
Method Name: plot_PyntCloud


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