| @@ 83-98 (lines=16) @@ | ||
| 80 | ||
| 81 | return _cand_ |
|
| 82 | ||
| 83 | def _init_opt_positioner(self, _cand_): |
|
| 84 | _p_ = Bayesian() |
|
| 85 | ||
| 86 | self._all_possible_pos(_cand_) |
|
| 87 | ||
| 88 | if self._opt_args_.warm_start_smbo: |
|
| 89 | self.X_sample = _cand_.mem._get_para() |
|
| 90 | self.Y_sample = _cand_.mem._get_score() |
|
| 91 | else: |
|
| 92 | self.X_sample = _cand_.pos_best.reshape(1, -1) |
|
| 93 | self.Y_sample = np.array(_cand_.score_best).reshape(1, -1) |
|
| 94 | ||
| 95 | _p_.pos_current = _cand_.pos_best |
|
| 96 | _p_.score_current = _cand_.score_best |
|
| 97 | ||
| 98 | return _p_ |
|
| 99 | ||
| 100 | ||
| 101 | class Bayesian(BasePositioner): |
|
| @@ 65-80 (lines=16) @@ | ||
| 62 | ||
| 63 | return _cand_ |
|
| 64 | ||
| 65 | def _init_opt_positioner(self, _cand_): |
|
| 66 | _p_ = Bayesian() |
|
| 67 | ||
| 68 | self._all_possible_pos(_cand_) |
|
| 69 | ||
| 70 | if self._opt_args_.warm_start_smbo: |
|
| 71 | self.X_sample = _cand_.mem._get_para() |
|
| 72 | self.Y_sample = _cand_.mem._get_score() |
|
| 73 | else: |
|
| 74 | self.X_sample = _cand_.pos_best.reshape(1, -1) |
|
| 75 | self.Y_sample = np.array(_cand_.score_best).reshape(1, -1) |
|
| 76 | ||
| 77 | _p_.pos_current = _cand_.pos_best |
|
| 78 | _p_.score_current = _cand_.score_best |
|
| 79 | ||
| 80 | return _p_ |
|
| 81 | ||
| 82 | ||
| 83 | class Bayesian(BasePositioner): |
|