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

Brent Minimizer #728

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Brent Minimizer #728

wants to merge 3 commits into from

Conversation

rfellers
Copy link

Hi all,

I recently was looking for a Brent minimizer when porting some python code to C# and I was hoping to find it here. FindMinimum.OfScalarFunctionConstrained() was pretty close, but given it is Golden Section under the covers, there were discrepancies with some inputs. I ended up porting the version from scipy _minimize_scalar_bounded().

I'd love to give back and contribute this port (and perhaps expand on it a little bit). Is this something of interest to the project? I've started a PR with a simple mock up of the rough API and tests I was thinking about (copied from GoldenSectionMinimizer).

Also, I noticed that there was quite a history with optimizers (#489, #173), so I thought I'd check first. I see that a BrentMinimizer class was considered in the past optimization-1. But it doesn't look like this has been updated in quite some time. Any insight here would be great.

@eriove
Copy link
Contributor

eriove commented Aug 27, 2020

I was one of the people who worked on getting the existing minimizers/solvers into MathNet Numerics. I underestimated the effort left where I took it up and while we got some solvers merged there's a lot of things that could be improved and added.

To me this looks like a great initiative (I'm not a maintainer though).

var obj = ObjectiveFunction.ScalarValue(f1);
var r1 = algorithm.FindMinimum(obj, -2, 2);

Assert.That(Math.Abs(r1.MinimizingPoint - 3.0), Is.LessThan(1e-4));
Copy link

@blhough blhough Jan 8, 2021

Choose a reason for hiding this comment

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

The upper bound is x≤2 so it should not reach the global min at x=3.
I believe the expected MinimizingPoint is x=2

The GoldenSectionMinimizer actually has a bug where it doesn't respect the bounds

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.

None yet

4 participants