Parcourir la source

set run initialization before surrogate training

Jérôme BUISINE il y a 4 ans
Parent
commit
21c9123181
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      optimization/ILSSurrogate.py

+ 3 - 3
optimization/ILSSurrogate.py

@@ -143,6 +143,9 @@ class ILSSurrogate(Algorithm):
         # enable resuming for ILS
         # enable resuming for ILS
         self.resume()
         self.resume()
 
 
+        # initialize current solution
+        self.initRun()
+
         if self.start_train_surrogate > self.getGlobalEvaluation():
         if self.start_train_surrogate > self.getGlobalEvaluation():
         
         
             # get `self.start_train_surrogate` number of real evaluations and save it into surrogate dataset file
             # get `self.start_train_surrogate` number of real evaluations and save it into surrogate dataset file
@@ -159,9 +162,6 @@ class ILSSurrogate(Algorithm):
 
 
                 self.increaseEvaluation()
                 self.increaseEvaluation()
 
 
-        # initialize current solution
-        self.initRun()
-
         # train surrogate on real evaluated solutions file
         # train surrogate on real evaluated solutions file
         self.train_surrogate()
         self.train_surrogate()
         self.load_surrogate()
         self.load_surrogate()