-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Section sampler #279
Section sampler #279
Conversation
Hard to tell if that's a related CI failure from a quick glance. |
Not sure how to solve this: the point of failure of the tests at Significantly, the issue seems to reproduce on the Having a deeper look to verify whether Zygote v0.6.12 tests pass on my machine. |
This looks like it was caused by FluxML/Zygote.jl#962. That makes the gradient of getindex a special immutable type, which probably should not be saved in So my guess is that the fix is something like this:
|
Yeah the user probably shouldn't be exposed to that type. That seems leaky. |
Yes, I mean as a quick check! If this fixes it, then it's a Zygote bug, and this should become a PR, with tests... |
Added the workaround suggested by Michael Abbott
to The |
Codecov Report
@@ Coverage Diff @@
## master #279 +/- ##
==========================================
+ Coverage 80.61% 80.79% +0.17%
==========================================
Files 19 19
Lines 2229 2301 +72
==========================================
+ Hits 1797 1859 +62
- Misses 432 442 +10
Continue to review full report at Codecov.
|
👍 upstream it to Zygote. |
Flux.jl was pushed 6 days ago to v0.12.6: I hope we can make it with the merge :-) |
Just eliminated the stale "workaround" that was still hanging in the code... |
It looks like the coverage went down 0.09%, which is preventing one last check from being passed. Looking into it.... |
Simplified a return statement. Also tried compressing comments - which should not count in coverage measurements anyway... |
Simplified return statement
All checks passed! :-) |
@@ -34,6 +34,12 @@ LowDiscrepancySample{T} | |||
sample(n,lb,ub,S::LowDiscrepancySample) | |||
``` | |||
|
|||
* Sample on section | |||
```@docs | |||
SectionSample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't have a docstring?
@@ -1711,3 +1711,82 @@ end | |||
end | |||
return pareto_set,pareto_front | |||
end | |||
|
|||
|
|||
function surrogate_optimize(obj::Function,::EI,lb,ub,krig,sample_type::SectionSample;maxiters=100,num_new_samples=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specialization may need docs.
Nice! Follow up with a bit more docs? |
In surrogate-based identification and control,
optimization can alternate between unconstrained sampling
in the full-dimensional parameter space,
and sampling constrained on specific sections (e.g. a planes in a 3D volume),
A
SectionSampler
allows sampling and optimizingon a subset of 'free' dimensions while keeping 'fixed' ones constrained.
The sampler is defined as in e.g.
where the first argument is a
Vector{T}
in which numbers are fixed coordinates
and
NaN
s correspond to free dimensions,and the second argument is a
SamplingAlgorithm
which is used to sample in the free dimensions.