Skip to content

Commit

Permalink
Add normalize_Y
Browse files Browse the repository at this point in the history
  • Loading branch information
jungtaekkim committed Nov 21, 2021
1 parent 155d55f commit 1fd9b6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bayeso/bo/bo_w_gp.py
Expand Up @@ -362,8 +362,12 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,

time_start = time.time()

if self.normalize_Y:
if self.normalize_Y and str_mlm_method != 'converged':
if self.debug:
self.logger.debug('Responses are normalized.')

Y_train = utils_bo.normalize_min_max(Y_train)
normalized_Y = True

time_start_surrogate = time.time()

Expand Down Expand Up @@ -455,6 +459,7 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,
dict_info = {
'next_points': next_points,
'acquisitions': acquisitions,
'normalize_Y': normalized_Y,
'Y_train': Y_train,
'cov_X_X': cov_X_X,
'inv_cov_X_X': inv_cov_X_X,
Expand Down
4 changes: 4 additions & 0 deletions bayeso/bo/bo_w_tp.py
Expand Up @@ -348,6 +348,9 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,
time_start = time.time()

if self.normalize_Y:
if self.debug:
self.logger.debug('Responses are normalized.')

Y_train = utils_bo.normalize_min_max(Y_train)

time_start_surrogate = time.time()
Expand Down Expand Up @@ -378,6 +381,7 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,
dict_info = {
'next_points': next_points,
'acquisitions': acquisitions,
'normalize_Y': self.normalize_Y,
'Y_train': Y_train,
'cov_X_X': cov_X_X,
'inv_cov_X_X': inv_cov_X_X,
Expand Down
6 changes: 5 additions & 1 deletion bayeso/bo/bo_w_trees.py
Expand Up @@ -236,6 +236,9 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,
time_start = time.time()

if self.normalize_Y:
if self.debug:
self.logger.debug('Responses are normalized.')

Y_train = utils_bo.normalize_min_max(Y_train)

time_start_surrogate = time.time()
Expand All @@ -262,8 +265,9 @@ def optimize(self, X_train: np.ndarray, Y_train: np.ndarray,

dict_info = {
'next_points': next_points,
'Y_train': Y_train,
'acquisitions': acquisitions,
'normalize_Y': self.normalize_Y,
'Y_train': Y_train,
'trees': trees,
'time_surrogate': time_end_surrogate - time_start_surrogate,
'time_acq': time_end_acq - time_start_acq,
Expand Down

0 comments on commit 1fd9b6d

Please sign in to comment.