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

BOHB implementation #54

Merged
merged 11 commits into from
Aug 3, 2021
Merged

BOHB implementation #54

merged 11 commits into from
Aug 3, 2021

Conversation

pizhn
Copy link
Contributor

@pizhn pizhn commented Jun 29, 2021

BOHB implementation

@pizhn
Copy link
Contributor Author

pizhn commented Jun 29, 2021

CI failed due to the library haven't been registered, waiting for that.
JuliaRegistries/General#39744

@baggepinnen
Copy link
Owner

Very cool, thanks for this PR! I'll try to take some time to review it before the weekend 😃

README.md Outdated
end
```

<!-- ### Empirical Result <sub><sup>[[code]](https://github.com/noil-reed/notebooks/blob/main/BOHB_demo/demo.ipynb)</sub></sup>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment supposed to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sorry about the comment stuff. I'll remove them

src/samplers.jl Outdated Show resolved Hide resolved
src/samplers.jl Outdated Show resolved Hide resolved
src/samplers.jl Outdated Show resolved Hide resolved
src/samplers.jl Outdated
else
ele = rand(1:dim_type.levels)
end
elseif dim_type isa MultiKDE.UnorderedCategoricalDim
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case appears to have logic identical to the case above?

src/samplers.jl Outdated Show resolved Hide resolved
MultiKDE.KDEMulti(dims, observations, candidates)
end

function Base.getproperty(dim_type::Union{MultiKDE.CategoricalDim, MultiKDE.UnorderedCategoricalDim}, v::Symbol)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this method do? It simply calls getfield no matter what argument is supplied?

test/BOHB.jl Outdated
end

# extra robust option
@macroexpand @hyperopt for i=18, sampler=Hyperband(R=50, η=3, inner=BOHB(dims=[Hyperopt.UnorderedCategorical(5), Hyperopt.Continuous(), Hyperopt.Continuous()])),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Why the @macroexpand?

@@ -53,12 +53,14 @@ f(a,b=true;c=10) = sum(@. 100 + (a-3)^2 + (b ? 10 : 20) + (c-100)^2) # This func
@test length(hol.results) == 200


hocl = @hyperopt for i=100, sampler=CLHSampler(dims=[Continuous(),Categorical(2),Continuous()]), a = LinRange(1,5,100), b = [true, false], c = exp10.(LinRange(-1,3,100))
# hocl = @hyperopt for i=100, sampler=CLHSampler(dims=[Hyperopt.ContinuousDim(),Hyperopt.CategoricalDim(2),Hyperopt.ContinuousDim()]), a = LinRange(1,5,100), b = [true, false], c = exp10.(LinRange(-1,3,100))
hocl = @hyperopt for i=100, sampler=CLHSampler(dims=[Hyperopt.Continuous(),Hyperopt.Categorical(2),Hyperopt.Continuous()]), a = LinRange(1,5,100), b = [true, false], c = exp10.(LinRange(-1,3,100))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the Hyperopt. here? these names are exported by Hyperopt

# println(i, "\t", a, "\t", b, "\t", c)
f(a,b,c=c)
end
@test minimum(hocl) < 300
@hyperopt for i=100, ho = hocl, sampler=CLHSampler(dims=[Continuous(),Categorical(2),Continuous()]), a = LinRange(1,5,100), b = [true, false], c = exp10.(LinRange(-1,3,100))
# @hyperopt for i=100, ho = hocl, sampler=CLHSampler(dims=[Hyperopt.ContinuousDim(),Hyperopt.CategoricalDim(2),Hyperopt.ContinuousDim()]), a = LinRange(1,5,100), b = [true, false], c = exp10.(LinRange(-1,3,100))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these comments be cleared up?

ericphanson and others added 2 commits July 3, 2021 09:09
doesn't run with the extra comma
@baggepinnen
Copy link
Owner

I've tried to add some changes and squash the commits in the branch down to a single commit, but I can't make git associate the commit with you if I do. May I ask you to squash these commits down to one? That way I can add my changes on top of that commit and still have git associate the contribution of the code to you.

@baggepinnen
Copy link
Owner

If you're not comfortable with git squash/rebase (I can't claim to be) the perhaps easiest way to do this is to create a new branch off of baggepinnen/master and simply copy the changes over from the branch https://github.com/baggepinnen/Hyperopt.jl/tree/noil-reed-MultiKDE where I performed the squash and applied all the changes. The problem with my branch noil-reed-MultiKDE is that it associates the contribution with me rather than with you, and I'd like to keep your contribution status, so I think the final PR has to come from you

@pizhn
Copy link
Contributor Author

pizhn commented Jul 3, 2021

Thank you so much Fredrik! I'll deal with it as soon as possible!

@pizhn
Copy link
Contributor Author

pizhn commented Jul 9, 2021

Hi Fredrik I just squashed the commits, I saw your fixes, thanks for that.

@baggepinnen
Copy link
Owner

Thanks! I'll be out of office for a week or so, will merge when I get back. Thanks for your work on this 😊

@Roger-luo
Copy link

just curious if there's any update on this PR?

@baggepinnen
Copy link
Owner

I'm on vacation and will not have time to test and merge it for at least another week.

@baggepinnen baggepinnen merged commit dae1a63 into baggepinnen:master Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants