graphinvent/Workflow.py
def generation_phase(self) -> None:
        """
        Generates molecules using a pre-trained model.
        """
        print("* Setting up generation job.", flush=True)
        self.load_training_set_properties()
        self.restart_epoch = self.constants.generation_epoch
        self.analyzer = Analyzer(valid_dataloader=None,
                                 train_dataloader=None,
                                 start_time=self.start_time)

        print(f"* Loading model from saved state (Epoch {self.restart_epoch}).",
              flush=True)
        model_path = (f"{self.constants.job_dir}"
                      f"model_restart_{self.restart_epoch}.pth")
        self.model = self.create_model()
        self.model = util.load_saved_model(model=self.model, path=model_path)

        self.model.eval()
        with torch.no_grad():
            self.generate_graphs(n_samples=self.constants.n_samples)

        self.print_time_elapsed()

        Generates molecules using a pre-trained model.
        
Generates molecules using a pre-trained model.
Generates molecules using a pre - trained model .
def generation_phase(self) -> None:
        print("* Setting up generation job.", flush=True)
        self.load_training_set_properties()
        self.restart_epoch = self.constants.generation_epoch
        self.analyzer = Analyzer(valid_dataloader=None,
                                 train_dataloader=None,
                                 start_time=self.start_time)
        print(f"* Loading model from saved state (Epoch {self.restart_epoch}).",
              flush=True)
        model_path = (f"{self.constants.job_dir}"
                      f"model_restart_{self.restart_epoch}.pth")
        self.model = self.create_model()
        self.model = util.load_saved_model(model=self.model, path=model_path)
        self.model.eval()
        with torch.no_grad():
            self.generate_graphs(n_samples=self.constants.n_samples)
        self.print_time_elapsed()
def generation_phase ( self ) -> None : print ( "* Setting up generation job." , flush = True ) self . load_training_set_properties ( ) self . restart_epoch = self . constants . generation_epoch self . analyzer = Analyzer ( valid_dataloader = None , train_dataloader = None , start_time = self . start_time ) print ( f"* Loading model from saved state (Epoch {self.restart_epoch})." , flush = True ) model_path = ( f"{self.constants.job_dir}" f"model_restart_{self.restart_epoch}.pth" ) self . model = self . create_model ( ) self . model = util . load_saved_model ( model = self . model , path = model_path ) self . model . eval ( ) with torch . no_grad ( ) : self . generate_graphs ( n_samples = self . constants . n_samples ) self . print_time_elapsed ( )
Generates molecules using a pre-trained model.
Generates molecules using a pre - trained model .
"""
        Generates molecules using a pre-trained model.
        """
self