def SBOAlg(self,m,nRepeat=10,Train=True,**kwargs): """ Run the SBO algorithm until m steps are taken. Args: m: Number of stepes of the algorithm. nRepeat: Number of random restarts to optimize the hyperparameters. Train: True if we want to train the kernel; False otherwise. """ if self.misc.create: #Create files for the results fl.createNewFilesFunc(self.path,self.misc.rs) fl.writeTraining(self) #Write training data if Train is True: self.trainModel(numStarts=nRepeat,**kwargs) #Train model points=self._VOI._points for i in range(m): print i #Optimize VOI if self.misc.parallel: self.optVOIParal(i,self.opt.numberParallel) else: self.optVOInoParal(i) print i #Otimize a_{n} if self.misc.parallel: self.optAnParal(i,self.opt.numberParallel) else: self.optAnnoParal(i) print i #Optimize a_{n} if self.misc.parallel: self.optAnParal(m,self.opt.numberParallel) else: self.optAnnoParal(i)
def KGAlg(self,m,nRepeat=1,Train=True,**kwargs): if self.misc.create: fl.createNewFilesFunc(self.path,self.misc.rs) fl.writeTraining(self) if Train is True: self.trainModel(numStarts=nRepeat,**kwargs) for i in range(m): print i if self.misc.parallel: self.optVOIParal(i,self.opt.numberParallel) else: self.optVOInoParal(i) print i if self.misc.parallel: self.optAnParal(i,self.opt.numberParallel) else: self.optAnnoParal(i) print i if self.misc.parallel: self.optAnParal(i,self.opt.numberParallel) else: self.optAnnoParal(i)