commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Sterijevski <gsterijev...@gmail.com>
Subject Re: BOBYQA Question
Date Sun, 02 Oct 2011 05:32:38 GMT
Knock yourself out with whatever changes you want to make. Change the class,
move it, rename it... the result is, unless my tests have a bug, the solvers
need some work.

Enjoy!

-Greg

On Sat, Oct 1, 2011 at 9:50 PM, Gilles Sadowski <
gilles@harfang.homelinux.org> wrote:

> Hi Greg.[1]
>
> On Sat, Oct 01, 2011 at 08:28:52PM -0500, Greg Sterijevski wrote:
> > Per Phil's suggestion, they are now in
> > test/../../optimizers/NISTBatteryTest.java See JIRA: MATH-678 for further
> > info.
>
> There currently isn't much info over there...
>
> Also, the new "NISTBatteryTest" test class is quite unwieldy. The usual way
> would be that one unit test class tests for its corresponding class in the
> "main" source code. E.g.
>  BOBYQAOptimizerTest
> contains tests for
>  BOBYQAOptimizer
>
> So, instead of clumping all tests for all optimizers in a single
> "BatteryTest"
> class (and discriminate by long method names that contain the optimizer
> class name), they should rather go in their own optimizer-dedicated
> classes,
> e.g.:
>  BOBYQAOptimizerNISTTest
>  PowellOptimizerNISTTest
>  etc.
> Hence someone can concentrate on fixing one optimizer at a time, focusing
> on
> one test class at a time.
>
> You can use inheritance in order to store all the common functionality:
>
> public class NISTAbstractTest {
>    // Common functions and general test routines and checks.
>
>    private double[] run(MultivariateRealOptimizer optim,
>                         DifferentiableMultivariateRealFunction func,
>                         double[] start) {
>        return optim.optimize(1000000, func, GoalType.MINIMIZE,
> start).getPointRef();
>    }
> }
>
> BOBYQAOptimizerNISTTest extends NISTAbstractTest {
>    @Test
>    public void lanczos() {
>        double[] result = run(new BOBYQAOptimizer(10),
>                              lanczosObjectFunc,
>                              new double[] { 1.2, 0.3, 5.6, 5.5, 6.5, 7.6
> });
>        TestUtils.assertEquals(correctParamLanczos, result, 1e-8);
>    }
> }
>
> That would also make it easier to connect specific JIRA tickets to specific
> issues/optimizers, as suggested by Phil.
>
> >
> > Incidentally, the tests were attached to the email thread in regard to
> > NonLinearConjugateGradientSolver.
>
> I didn't get any message with such an attachement. Are you sure that it
> wasn't stripped off?
> Anyways, _this_ thread, and my question, is about coverage of the BOBYQA
> code. Testing for this shortcoming of our BOBYQA test suite is not the same
> issue as an optimizer failing the NIST test suite. Hence the request to
> create a specific (and possibly temporary) "BOBYQAOptimizerCoverageTest".
>
>
> Best regards,
> Gilles
>
> [1] A: Because it messes up the order in which people normally read text.
>    Q: Why is top-posting such a bad thing?
>    A: Top-posting.
>    Q: What is the most annoying thing in e-mail?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message