Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction of default_value type in UniformFloatHyperparameter and UniformIntegerHyperparameter #337

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a817c9b
Ensure that type of `default_value` in `UniformFloatHyperparameter` i…
BrunoBelucci Jul 25, 2023
313043d
Cast another default_value to float in UniformFloatHyperparameter
BrunoBelucci Jul 26, 2023
325a9eb
Accept None as default_value in IntegerHyperparameter
BrunoBelucci Jul 26, 2023
eb68381
Accept float as vector in _inverse_transform from NormalFloatHyperpar…
BrunoBelucci Jul 26, 2023
f932461
Accept float as vector in _inverse_transform from NormalFloatHyperpar…
BrunoBelucci Jul 26, 2023
da50efe
Merge remote-tracking branch 'origin/main'
BrunoBelucci Jul 26, 2023
d70e49b
Accept None in is_legal from UniformIntegerHyperparameter
BrunoBelucci Jul 26, 2023
ac17bee
Accept None in check_default from NormalIntegerHyperparameter
BrunoBelucci Jul 26, 2023
b1a0092
Accept Hyperparameter in ForbiddenInClause (not sure if we should acc…
BrunoBelucci Jul 26, 2023
555ce35
cast default_value passed to parent class of BetaIntegerHyperparamete…
BrunoBelucci Jul 26, 2023
eb70b06
Only accepts int as lower and upper bound of BetaIntegerHyperparamete…
BrunoBelucci Jul 26, 2023
c44058b
accept int in check_default in UniformFloatHyperparameter, as long as…
BrunoBelucci Jul 26, 2023
c16d41d
Fix tests to correctly pass ints as upper and lower bound of BetaInte…
BrunoBelucci Jul 26, 2023
9933d75
In NormalIntegerHyperparameter, accept mu as float, accept to check …
BrunoBelucci Jul 26, 2023
9ab8b38
pass int to lower and upper bound in to_uniform in NormalIntegerHyper…
BrunoBelucci Jul 26, 2023
0784ce3
Commented out 3 tests until we now if we can accept floats in Uniform…
BrunoBelucci Jul 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ConfigSpace/hyperparameters/uniform_float.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ cdef class UniformFloatHyperparameter(FloatHyperparameter):
default_value = np.exp((np.log(self.lower) + np.log(self.upper)) / 2.)
else:
default_value = (self.lower + self.upper) / 2.
default_value = np.round(float(default_value), 10)
default_value = float(np.round(float(default_value), 10))

if self.is_legal(default_value):
return default_value
Expand Down
2 changes: 1 addition & 1 deletion ConfigSpace/hyperparameters/uniform_integer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cdef class UniformIntegerHyperparameter(IntegerHyperparameter):
self.lower - 0.49999,
self.upper + 0.49999,
log=self.log,
default_value=self.default_value)
default_value=float(self.default_value))

self.normalized_default_value = self._inverse_transform(self.default_value)

Expand Down
Loading