浏览代码

set run initialization before surrogate training

Jérôme BUISINE 4 年之前
父节点
当前提交
21c9123181
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      optimization/ILSSurrogate.py

+ 3 - 3
optimization/ILSSurrogate.py

@@ -143,6 +143,9 @@ class ILSSurrogate(Algorithm):
         # enable resuming for ILS
         self.resume()
 
+        # initialize current solution
+        self.initRun()
+
         if self.start_train_surrogate > self.getGlobalEvaluation():
         
             # 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()
 
-        # initialize current solution
-        self.initRun()
-
         # train surrogate on real evaluated solutions file
         self.train_surrogate()
         self.load_surrogate()