Skip to content

Commit

Permalink
Merge branch 'develop' into release-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Aug 30, 2024
2 parents 24c0632 + e82560c commit 75c37f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion physbo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
from .predictor import base_predictor
from .variable import variable

__version__ = "2.0.1"
__version__ = "2.1-dev"
8 changes: 7 additions & 1 deletion physbo/search/discrete/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,13 @@ def load(self, file_history, file_training=None, file_predictor=None):
self.predictor = pickle.load(f)

N = self.history.total_num_search
self.actions = self._delete_actions(self.history.chosen_actions[:N])

visited = self.history.chosen_actions[:N]
local_index = np.searchsorted(self.actions, visited)
local_index = local_index[
np.take(self.actions, local_index, mode="clip") == visited
]
self.actions = self._delete_actions(local_index)

def export_predictor(self):
"""
Expand Down
8 changes: 7 additions & 1 deletion physbo/search/discrete_multi/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,13 @@ def load(self, file_history, file_training_list=None, file_predictor_list=None):
self.load_predictor_list(file_predictor_list)

N = self.history.total_num_search
self.actions = self._delete_actions(self.history.chosen_actions[:N])

visited = self.history.chosen_actions[:N]
local_index = np.searchsorted(self.actions, visited)
local_index = local_index[
np.take(self.actions, local_index, mode="clip") == visited
]
self.actions = self._delete_actions(local_index)

def save_predictor_list(self, file_name):
with open(file_name, "wb") as f:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = physbo
version = 2.0.1
version = 2.1.dev1
description = optimization tool for PHYSics based on Bayesian Optimization
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 75c37f6

Please sign in to comment.