hypertune 1.1.0rc45__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
- hypertune/matrix/utils.py +92 -24
- hypertune/pkg.py +1 -1
- hypertune/search_managers/bayesian_optimization/acquisition_function.py +1 -1
- {hypertune-1.1.0rc45.dist-info → hypertune-1.2.0.dist-info}/METADATA +11 -10
- {hypertune-1.1.0rc45.dist-info → hypertune-1.2.0.dist-info}/RECORD +8 -8
- {hypertune-1.1.0rc45.dist-info → hypertune-1.2.0.dist-info}/WHEEL +1 -1
- {hypertune-1.1.0rc45.dist-info → hypertune-1.2.0.dist-info}/LICENSE +0 -0
- {hypertune-1.1.0rc45.dist-info → hypertune-1.2.0.dist-info}/top_level.txt +0 -0
hypertune/matrix/utils.py
CHANGED
@@ -2,7 +2,7 @@ import numpy as np
|
|
2
2
|
|
3
3
|
from datetime import date, datetime
|
4
4
|
|
5
|
-
from clipped.compact.pydantic import ValidationError
|
5
|
+
from clipped.compact.pydantic import PYDANTIC_VERSION, ValidationError
|
6
6
|
|
7
7
|
from hypertune.matrix import dist
|
8
8
|
from polyaxon.schemas import (
|
@@ -97,9 +97,25 @@ def get_length(matrix):
|
|
97
97
|
V1HpLogNormal._IDENTIFIER,
|
98
98
|
V1HpQLogNormal._IDENTIFIER,
|
99
99
|
}:
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
error_msg = "Distribution should not call `length`"
|
101
|
+
if PYDANTIC_VERSION.startswith("2."):
|
102
|
+
raise ValidationError.from_exception_data(
|
103
|
+
title="Value Error",
|
104
|
+
line_errors=[
|
105
|
+
{
|
106
|
+
"type": "value_error",
|
107
|
+
"loc": ("get_length",),
|
108
|
+
# Location tuple indicating where the error occurred
|
109
|
+
"msg": error_msg,
|
110
|
+
"input": matrix.__class__, # The invalid input that caused the error
|
111
|
+
"ctx": {"error": error_msg},
|
112
|
+
}
|
113
|
+
],
|
114
|
+
)
|
115
|
+
else:
|
116
|
+
raise ValidationError(
|
117
|
+
["Distribution should not call `length`"], matrix.__class__
|
118
|
+
)
|
103
119
|
|
104
120
|
|
105
121
|
def get_min(matrix):
|
@@ -175,13 +191,31 @@ def to_numpy(matrix):
|
|
175
191
|
return matrix.value
|
176
192
|
|
177
193
|
if matrix._IDENTIFIER == V1HpPChoice._IDENTIFIER:
|
178
|
-
|
179
|
-
|
180
|
-
"Distribution should not call `to_numpy`, "
|
181
|
-
"instead it should call `sample`."
|
182
|
-
],
|
183
|
-
matrix.__class__,
|
194
|
+
error_msg = (
|
195
|
+
"Distribution should not call `to_numpy`, instead it should call `sample`."
|
184
196
|
)
|
197
|
+
if PYDANTIC_VERSION.startswith("2."):
|
198
|
+
raise ValidationError.from_exception_data(
|
199
|
+
title="Value Error",
|
200
|
+
line_errors=[
|
201
|
+
{
|
202
|
+
"type": "value_error",
|
203
|
+
"loc": ("get_length",),
|
204
|
+
# Location tuple indicating where the error occurred
|
205
|
+
"msg": error_msg,
|
206
|
+
"input": matrix.__class__, # The invalid input that caused the error
|
207
|
+
"ctx": {"error": error_msg},
|
208
|
+
}
|
209
|
+
],
|
210
|
+
)
|
211
|
+
else:
|
212
|
+
raise ValidationError( # TODO: Fix error message
|
213
|
+
[
|
214
|
+
"Distribution should not call `to_numpy`, "
|
215
|
+
"instead it should call `sample`."
|
216
|
+
],
|
217
|
+
matrix.__class__,
|
218
|
+
)
|
185
219
|
|
186
220
|
if matrix._IDENTIFIER == V1HpDateRange._IDENTIFIER:
|
187
221
|
return np.arange(**matrix.value.to_dict()).astype(date)
|
@@ -211,13 +245,31 @@ def to_numpy(matrix):
|
|
211
245
|
V1HpLogNormal._IDENTIFIER,
|
212
246
|
V1HpQLogNormal._IDENTIFIER,
|
213
247
|
}:
|
214
|
-
|
215
|
-
|
216
|
-
"Distribution should not call `to_numpy`, "
|
217
|
-
"instead it should call `sample`."
|
218
|
-
],
|
219
|
-
matrix.__class__,
|
248
|
+
error_msg = (
|
249
|
+
"Distribution should not call `to_numpy`, instead it should call `sample`."
|
220
250
|
)
|
251
|
+
if PYDANTIC_VERSION.startswith("2."):
|
252
|
+
raise ValidationError.from_exception_data(
|
253
|
+
title="Value Error",
|
254
|
+
line_errors=[
|
255
|
+
{
|
256
|
+
"type": "value_error",
|
257
|
+
"loc": ("get_length",),
|
258
|
+
# Location tuple indicating where the error occurred
|
259
|
+
"msg": error_msg,
|
260
|
+
"input": matrix.__class__, # The invalid input that caused the error
|
261
|
+
"ctx": {"error": error_msg},
|
262
|
+
}
|
263
|
+
],
|
264
|
+
)
|
265
|
+
else:
|
266
|
+
raise ValidationError(
|
267
|
+
[
|
268
|
+
"Distribution should not call `to_numpy`, "
|
269
|
+
"instead it should call `sample`."
|
270
|
+
],
|
271
|
+
matrix.__class__,
|
272
|
+
)
|
221
273
|
|
222
274
|
|
223
275
|
def _sample(matrix, size=None, rand_generator=None):
|
@@ -295,11 +347,27 @@ def sample(matrix, size=None, rand_generator=None):
|
|
295
347
|
try:
|
296
348
|
return _sample(matrix, size=size, rand_generator=rand_generator)
|
297
349
|
except Exception as e:
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
350
|
+
error_msg = (
|
351
|
+
"Could not sample from matrix value: {} for kind: {} with size: {}".format(
|
352
|
+
matrix.value, matrix._IDENTIFIER, size
|
353
|
+
)
|
354
|
+
)
|
355
|
+
if PYDANTIC_VERSION.startswith("2."):
|
356
|
+
raise ValidationError.from_exception_data(
|
357
|
+
title="Value Error",
|
358
|
+
line_errors=[
|
359
|
+
{
|
360
|
+
"type": "value_error",
|
361
|
+
"loc": ("get_length",),
|
362
|
+
# Location tuple indicating where the error occurred
|
363
|
+
"msg": error_msg,
|
364
|
+
"input": matrix.__class__, # The invalid input that caused the error
|
365
|
+
"ctx": {"error": error_msg},
|
366
|
+
}
|
367
|
+
],
|
368
|
+
) from e
|
369
|
+
else:
|
370
|
+
raise ValidationError(
|
371
|
+
[error_msg],
|
372
|
+
matrix.__class__,
|
373
|
+
) from e
|
hypertune/pkg.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hypertune
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.2.0
|
4
4
|
Summary: A library for performing hyperparameter optimization with Polyaxon.
|
5
5
|
Home-page: https://github.com/polyaxon/hypertune
|
6
6
|
Author: Polyaxon, Inc.
|
@@ -34,17 +34,18 @@ Requires-Python: >=3.8
|
|
34
34
|
Description-Content-Type: text/markdown
|
35
35
|
License-File: LICENSE
|
36
36
|
Provides-Extra: all
|
37
|
-
Requires-Dist: scikit-learn
|
38
|
-
Requires-Dist: hyperopt
|
37
|
+
Requires-Dist: scikit-learn; extra == "all"
|
38
|
+
Requires-Dist: hyperopt; extra == "all"
|
39
39
|
Provides-Extra: dev
|
40
|
-
Requires-Dist: pandas
|
41
|
-
Requires-Dist: ipython
|
42
|
-
Requires-Dist: numpy
|
43
|
-
Requires-Dist: scipy
|
44
|
-
Requires-Dist: scikit-learn
|
45
|
-
Requires-Dist: hyperopt
|
40
|
+
Requires-Dist: pandas; extra == "dev"
|
41
|
+
Requires-Dist: ipython; extra == "dev"
|
42
|
+
Requires-Dist: numpy; extra == "dev"
|
43
|
+
Requires-Dist: scipy; extra == "dev"
|
44
|
+
Requires-Dist: scikit-learn<1.6; extra == "dev"
|
45
|
+
Requires-Dist: hyperopt<0.2.8; extra == "dev"
|
46
|
+
Requires-Dist: setuptools; extra == "dev"
|
46
47
|
Provides-Extra: polyaxon
|
47
|
-
Requires-Dist: polyaxon
|
48
|
+
Requires-Dist: polyaxon; extra == "polyaxon"
|
48
49
|
|
49
50
|
[](LICENSE)
|
50
51
|
[](https://github.com/polyaxon/hypertune/actions/workflows/hypertune.yml)
|
@@ -1,17 +1,17 @@
|
|
1
1
|
hypertune/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
2
2
|
hypertune/iteration_lineage.py,sha256=z515AFwiJd9w8LjmS_9fZ3Isi3XWB1deNQtr_OssoaE,2886
|
3
3
|
hypertune/logger.py,sha256=IHyqYlPIbssr8aCrewsPyxUBpgYPFWqvRithcGd7RDc,56
|
4
|
-
hypertune/pkg.py,sha256=
|
4
|
+
hypertune/pkg.py,sha256=BW9xgRq8hp2J6KnWWX9x7wpOQuLBX7nxxpzqSFuGUzg,240
|
5
5
|
hypertune/matrix/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
6
6
|
hypertune/matrix/dist.py,sha256=4d0jdcmaMGkTjpZvkRsnsA5PgzvO4g323LZ9mVdiDuA,1442
|
7
7
|
hypertune/matrix/hyperopt.py,sha256=d4q50BaHQCU62YnpEKr8-m7NAvMR73aRhB1tDPXHwzo,2175
|
8
|
-
hypertune/matrix/utils.py,sha256=
|
8
|
+
hypertune/matrix/utils.py,sha256=SQFV3uGr3UGTfHRSKqLjRexsFoNEzTixUeocP3Q8PcM,12335
|
9
9
|
hypertune/search_managers/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
10
10
|
hypertune/search_managers/base.py,sha256=IIPiJYBqexlIF9T-2JdPyVzoWSsrN-XDOOHuYltoGfA,539
|
11
11
|
hypertune/search_managers/spec.py,sha256=Z0Vq14yaA5MEz1lbaay8QSCIRIjTWnYQjPzaU0KhRfY,725
|
12
12
|
hypertune/search_managers/utils.py,sha256=8gLvRNTmFTm6xUDx3HgHv4h4_Dl5ywGHpAffIM6Tm5E,134
|
13
13
|
hypertune/search_managers/bayesian_optimization/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
14
|
-
hypertune/search_managers/bayesian_optimization/acquisition_function.py,sha256=
|
14
|
+
hypertune/search_managers/bayesian_optimization/acquisition_function.py,sha256=W524peBo9rGvahBhlb4s96isR-Pk0f7Z7K7wX-x2xVo,4706
|
15
15
|
hypertune/search_managers/bayesian_optimization/manager.py,sha256=D9onVt4EWkTjNQcVf1yQo1J4sPmLB1sqfQ6-sctpc60,1268
|
16
16
|
hypertune/search_managers/bayesian_optimization/optimizer.py,sha256=fNxLnBpSFPVWeGNhDp_OGUwhT6h_VzOV32pY9TeNzJQ,1304
|
17
17
|
hypertune/search_managers/bayesian_optimization/space.py,sha256=gNXMHeUeCyaMurkImNuKRb7Lbo2e1ar6LbOxqN0N4o0,5265
|
@@ -25,8 +25,8 @@ hypertune/search_managers/mapping/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZ
|
|
25
25
|
hypertune/search_managers/mapping/manager.py,sha256=nDeS5PkD2FEX151MUpB2GWelpO_V6Yvh46NZzVVDqC8,632
|
26
26
|
hypertune/search_managers/random_search/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
27
27
|
hypertune/search_managers/random_search/manager.py,sha256=NhkRCAtrkVm63YC7TCdzeQJcvK2xRYoMzU1ImZinnJY,1850
|
28
|
-
hypertune-1.
|
29
|
-
hypertune-1.
|
30
|
-
hypertune-1.
|
31
|
-
hypertune-1.
|
32
|
-
hypertune-1.
|
28
|
+
hypertune-1.2.0.dist-info/LICENSE,sha256=86kroZbQUDsmSWOomB7dpceG65UXiVSPob4581tStBc,11349
|
29
|
+
hypertune-1.2.0.dist-info/METADATA,sha256=pXf6CMpyB8N5NYbGIxWHdkV-fbiMc1-h4YUjC24vX7Q,3334
|
30
|
+
hypertune-1.2.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
31
|
+
hypertune-1.2.0.dist-info/top_level.txt,sha256=96t0aNwmDTWYuj8VXyzogiQ8zBV06FCXZic8xyMTY14,10
|
32
|
+
hypertune-1.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|