physbo 2.0.0__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. {physbo-2.0.0 → physbo-2.0.2}/PKG-INFO +6 -4
  2. {physbo-2.0.0 → physbo-2.0.2}/README.md +5 -3
  3. {physbo-2.0.0 → physbo-2.0.2}/physbo/__init__.py +1 -1
  4. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete/policy.py +16 -6
  5. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete/results.py +2 -2
  6. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete_multi/policy.py +16 -7
  7. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete_multi/results.py +2 -2
  8. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/PKG-INFO +6 -4
  9. physbo-2.0.2/pyproject.toml +3 -0
  10. {physbo-2.0.0 → physbo-2.0.2}/setup.cfg +1 -1
  11. physbo-2.0.0/pyproject.toml +0 -3
  12. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/__init__.py +0 -0
  13. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/basis/__init__.py +0 -0
  14. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/basis/fourier.py +0 -0
  15. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/core/__init__.py +0 -0
  16. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/core/model.py +0 -0
  17. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/inf/__init__.py +0 -0
  18. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/inf/exact.py +0 -0
  19. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/lik/__init__.py +0 -0
  20. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/lik/_src/__init__.py +0 -0
  21. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/lik/_src/cov.py +0 -0
  22. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/lik/gauss.py +0 -0
  23. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/lik/linear.py +0 -0
  24. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/predictor.py +0 -0
  25. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/prior/__init__.py +0 -0
  26. {physbo-2.0.0 → physbo-2.0.2}/physbo/blm/prior/gauss.py +0 -0
  27. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/__init__.py +0 -0
  28. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/core/__init__.py +0 -0
  29. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/core/learning.py +0 -0
  30. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/core/model.py +0 -0
  31. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/core/prior.py +0 -0
  32. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/cov/__init__.py +0 -0
  33. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/cov/_src/__init__.py +0 -0
  34. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/cov/_src/enhance_gauss.pyx +0 -0
  35. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/cov/gauss.py +0 -0
  36. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/inf/__init__.py +0 -0
  37. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/inf/exact.py +0 -0
  38. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/lik/__init__.py +0 -0
  39. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/lik/gauss.py +0 -0
  40. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/mean/__init__.py +0 -0
  41. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/mean/const.py +0 -0
  42. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/mean/zero.py +0 -0
  43. {physbo-2.0.0 → physbo-2.0.2}/physbo/gp/predictor.py +0 -0
  44. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/__init__.py +0 -0
  45. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/_src/__init__.py +0 -0
  46. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/_src/cholupdate.pyx +0 -0
  47. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/_src/diagAB.pyx +0 -0
  48. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/_src/logsumexp.pyx +0 -0
  49. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/_src/traceAB.pyx +0 -0
  50. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/centering.py +0 -0
  51. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/gauss_elim.py +0 -0
  52. {physbo-2.0.0 → physbo-2.0.2}/physbo/misc/set_config.py +0 -0
  53. {physbo-2.0.0 → physbo-2.0.2}/physbo/opt/__init__.py +0 -0
  54. {physbo-2.0.0 → physbo-2.0.2}/physbo/opt/adam.py +0 -0
  55. {physbo-2.0.0 → physbo-2.0.2}/physbo/predictor.py +0 -0
  56. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/__init__.py +0 -0
  57. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete/__init__.py +0 -0
  58. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/discrete_multi/__init__.py +0 -0
  59. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/pareto.py +0 -0
  60. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/score.py +0 -0
  61. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/score_multi.py +0 -0
  62. {physbo-2.0.0 → physbo-2.0.2}/physbo/search/utility.py +0 -0
  63. {physbo-2.0.0 → physbo-2.0.2}/physbo/variable.py +0 -0
  64. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/SOURCES.txt +0 -0
  65. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/dependency_links.txt +0 -0
  66. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/not-zip-safe +0 -0
  67. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/requires.txt +0 -0
  68. {physbo-2.0.0 → physbo-2.0.2}/physbo.egg-info/top_level.txt +0 -0
  69. {physbo-2.0.0 → physbo-2.0.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: physbo
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: optimization tool for PHYSics based on Bayesian Optimization
5
5
  Home-page: https://github.com/issp-center-dev/PHYSBO
6
6
  Author: PHYSBO developers
@@ -18,7 +18,7 @@ A standard implementation (e.g., scikit-learn), however, can accommodate only sm
18
18
  PHYSBO is highly scalable due to an efficient protocol that employs Thompson sampling, random feature maps, one-rank Cholesky update and automatic hyperparameter tuning. Technical features are described in [COMBO's document](https://github.com/tsudalab/combo/blob/master/docs/combo_document.pdf) and [PHYSBO's report](https://doi.org/10.1016/j.cpc.2022.108405) (open access).
19
19
  PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for academic use.
20
20
 
21
- ## Document
21
+ ## Documentation
22
22
 
23
23
  - Stable (master branch)
24
24
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/index.html)
@@ -27,7 +27,7 @@ PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for aca
27
27
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/develop/en/index.html)
28
28
  - [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/index.html)
29
29
 
30
- ## Required Packages
30
+ ## Dependencies
31
31
 
32
32
  - Python >= 3.6
33
33
  - No longer tested with Python 3.6
@@ -74,7 +74,9 @@ python3 -m pip uninstall physbo
74
74
 
75
75
  ## Usage
76
76
 
77
- ['examples/simple.py'](https://github.com/issp-center-dev/PHYSBO/examples/simple.py) is a simple example.
77
+ For an introductory tutorial please consult the documentation. ([English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/notebook/tutorial_basic.html) / [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/install.html#id2))
78
+
79
+ ['examples/simple.py'](./examples/simple.py) is a simple example.
78
80
 
79
81
  ## Data repository
80
82
 
@@ -5,7 +5,7 @@ A standard implementation (e.g., scikit-learn), however, can accommodate only sm
5
5
  PHYSBO is highly scalable due to an efficient protocol that employs Thompson sampling, random feature maps, one-rank Cholesky update and automatic hyperparameter tuning. Technical features are described in [COMBO's document](https://github.com/tsudalab/combo/blob/master/docs/combo_document.pdf) and [PHYSBO's report](https://doi.org/10.1016/j.cpc.2022.108405) (open access).
6
6
  PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for academic use.
7
7
 
8
- ## Document
8
+ ## Documentation
9
9
 
10
10
  - Stable (master branch)
11
11
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/index.html)
@@ -14,7 +14,7 @@ PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for aca
14
14
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/develop/en/index.html)
15
15
  - [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/index.html)
16
16
 
17
- ## Required Packages
17
+ ## Dependencies
18
18
 
19
19
  - Python >= 3.6
20
20
  - No longer tested with Python 3.6
@@ -61,7 +61,9 @@ python3 -m pip uninstall physbo
61
61
 
62
62
  ## Usage
63
63
 
64
- ['examples/simple.py'](https://github.com/issp-center-dev/PHYSBO/examples/simple.py) is a simple example.
64
+ For an introductory tutorial please consult the documentation. ([English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/notebook/tutorial_basic.html) / [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/install.html#id2))
65
+
66
+ ['examples/simple.py'](./examples/simple.py) is a simple example.
65
67
 
66
68
  ## Data repository
67
69
 
@@ -14,4 +14,4 @@ from . import predictor
14
14
  from .predictor import base_predictor
15
15
  from .variable import variable
16
16
 
17
- __version__ = "2.0.0"
17
+ __version__ = "2.0.2"
@@ -138,11 +138,15 @@ class policy:
138
138
  time_run_simulator=time_run_simulator,
139
139
  )
140
140
  self.training.add(X=X, t=t, Z=Z)
141
- local_index = np.searchsorted(self.actions, action)
142
- local_index = local_index[
143
- np.take(self.actions, local_index, mode="clip") == action
144
- ]
145
- self.actions = self._delete_actions(local_index)
141
+
142
+ # remove the selected actions from the list of candidates if exists
143
+ if len(self.actions) > 0:
144
+ local_index = np.searchsorted(self.actions, action)
145
+ local_index = local_index[
146
+ np.take(self.actions, local_index, mode="clip") == action
147
+ ]
148
+ self.actions = self._delete_actions(local_index)
149
+
146
150
  if self.new_data is None:
147
151
  self.new_data = variable(X=X, t=t, Z=Z)
148
152
  else:
@@ -690,7 +694,13 @@ class policy:
690
694
  self.predictor = pickle.load(f)
691
695
 
692
696
  N = self.history.total_num_search
693
- self.actions = self._delete_actions(self.history.chosen_actions[:N])
697
+
698
+ visited = self.history.chosen_actions[:N]
699
+ local_index = np.searchsorted(self.actions, visited)
700
+ local_index = local_index[
701
+ np.take(self.actions, local_index, mode="clip") == visited
702
+ ]
703
+ self.actions = self._delete_actions(local_index)
694
704
 
695
705
  def export_predictor(self):
696
706
  """
@@ -183,8 +183,8 @@ class history:
183
183
 
184
184
  """
185
185
  data = np.load(filename)
186
- M = data["num_runs"]
187
- N = data["total_num_search"]
186
+ M = int(data["num_runs"])
187
+ N = int(data["total_num_search"])
188
188
  self.num_runs = M
189
189
  self.total_num_search = N
190
190
  self.fx[0:N] = data["fx"]
@@ -58,7 +58,7 @@ class policy(discrete.policy):
58
58
  msg = "ERROR: len(initial_data[0]) != initial_data[1].shape[0]"
59
59
  raise RuntimeError(msg)
60
60
  self.write(actions, fs)
61
- self.actions = sorted(list(set(self.actions) - set(actions)))
61
+ self.actions = np.array(sorted(list(set(self.actions) - set(actions))))
62
62
 
63
63
  if comm is None:
64
64
  self.mpicomm = None
@@ -106,11 +106,14 @@ class policy(discrete.policy):
106
106
  else:
107
107
  self.new_data_list[i].add(X=X, t=t[:, i], Z=Z)
108
108
  self.training_list[i].add(X=X, t=t[:, i], Z=Z)
109
- local_index = np.searchsorted(self.actions, action)
110
- local_index = local_index[
111
- np.take(self.actions, local_index, mode="clip") == action
112
- ]
113
- self.actions = self._delete_actions(local_index)
109
+
110
+ # remove action from candidates if exists
111
+ if len(self.actions) > 0:
112
+ local_index = np.searchsorted(self.actions, action)
113
+ local_index = local_index[
114
+ np.take(self.actions, local_index, mode="clip") == action
115
+ ]
116
+ self.actions = self._delete_actions(local_index)
114
117
 
115
118
  def _model(self, i):
116
119
  training = self.training_list[i]
@@ -487,7 +490,13 @@ class policy(discrete.policy):
487
490
  self.load_predictor_list(file_predictor_list)
488
491
 
489
492
  N = self.history.total_num_search
490
- self.actions = self._delete_actions(self.history.chosen_actions[:N])
493
+
494
+ visited = self.history.chosen_actions[:N]
495
+ local_index = np.searchsorted(self.actions, visited)
496
+ local_index = local_index[
497
+ np.take(self.actions, local_index, mode="clip") == visited
498
+ ]
499
+ self.actions = self._delete_actions(local_index)
491
500
 
492
501
  def save_predictor_list(self, file_name):
493
502
  with open(file_name, "wb") as f:
@@ -118,8 +118,8 @@ class history(object):
118
118
  with open(filename, "rb") as f:
119
119
  data = pickle.load(f)
120
120
 
121
- M = data["num_runs"]
122
- N = data["total_num_search"]
121
+ M = int(data["num_runs"])
122
+ N = int(data["total_num_search"])
123
123
  self.num_runs = M
124
124
  self.total_num_search = N
125
125
  self.fx[0:N] = data["fx"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: physbo
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: optimization tool for PHYSics based on Bayesian Optimization
5
5
  Home-page: https://github.com/issp-center-dev/PHYSBO
6
6
  Author: PHYSBO developers
@@ -18,7 +18,7 @@ A standard implementation (e.g., scikit-learn), however, can accommodate only sm
18
18
  PHYSBO is highly scalable due to an efficient protocol that employs Thompson sampling, random feature maps, one-rank Cholesky update and automatic hyperparameter tuning. Technical features are described in [COMBO's document](https://github.com/tsudalab/combo/blob/master/docs/combo_document.pdf) and [PHYSBO's report](https://doi.org/10.1016/j.cpc.2022.108405) (open access).
19
19
  PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for academic use.
20
20
 
21
- ## Document
21
+ ## Documentation
22
22
 
23
23
  - Stable (master branch)
24
24
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/index.html)
@@ -27,7 +27,7 @@ PHYSBO was developed based on [COMBO](https://github.com/tsudalab/combo) for aca
27
27
  - [English](https://issp-center-dev.github.io/PHYSBO/manual/develop/en/index.html)
28
28
  - [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/index.html)
29
29
 
30
- ## Required Packages
30
+ ## Dependencies
31
31
 
32
32
  - Python >= 3.6
33
33
  - No longer tested with Python 3.6
@@ -74,7 +74,9 @@ python3 -m pip uninstall physbo
74
74
 
75
75
  ## Usage
76
76
 
77
- ['examples/simple.py'](https://github.com/issp-center-dev/PHYSBO/examples/simple.py) is a simple example.
77
+ For an introductory tutorial please consult the documentation. ([English](https://issp-center-dev.github.io/PHYSBO/manual/master/en/notebook/tutorial_basic.html) / [日本語](https://issp-center-dev.github.io/PHYSBO/manual/develop/ja/install.html#id2))
78
+
79
+ ['examples/simple.py'](./examples/simple.py) is a simple example.
78
80
 
79
81
  ## Data repository
80
82
 
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel", "cython", "numpy<2.0"]
3
+ build-backend = "setuptools.build_meta"
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = physbo
3
- version = 2.0.0
3
+ version = 2.0.2
4
4
  description = optimization tool for PHYSics based on Bayesian Optimization
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -1,3 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools", "wheel", "cython", "numpy<1.20; python_version<'3.10'", "numpy; python_version>='3.10'"]
3
- build-backend = "setuptools.build_meta"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes