Coder Social home page Coder Social logo

Comments (4)

btracey avatar btracey commented on July 2, 2024

Here's how it should be. xNext says where to evalute, EvalutaionType says how to evaluate it, and IterationType essentially captures the meta-information about the function evalutaion. It's supposed to be information about the upcoming function information, and not information about the previous information. I think a single function evaluation is the right way to go. In optimize's worth vision, an optimize.Method states the next evaluation it wants to see to work toward a (local) minimum. Directly, this is {xNext, EvalutionType}, and IterationType is meta-information to help out the rest of the process. Two different functions seems like it would just create complicated state.

This mindset does have a problem in the case of linesearch. In a linesearch, it ends that the last location in the minor iteration is also the initial location in the major evaluation. However, until you've seen the function value, you don't actually know it's true. I imagine this is the issue with my interpretation of IterationType (a description of the upcoming evaluation), and your interpretation (a description of what just happened). A way to fix this is to have an EvalutaionType that is NoEvaluation (name tbd). The Linesarch struct is performing the linsearch, sending new locations and MinorIteration. It concludes successfully (the previous point having been a MinorIteration), so now Linesearch sends a MajorIteration, as it would be. However, Linesearch doesn't actually need more information at that location; it already has it from the linesearch evaluation, so it sends the same x location and a NoEvaluation. Thus, checkConvergence() and Recorder are properly signaled when the MajorIteration started, but we don't waste additional function evaluations by evaluating things twice.

from optimize.

vladimir-ch avatar vladimir-ch commented on July 2, 2024

Here's how it should be. xNext says where to evalute, EvalutaionType says how to evaluate it, and IterationType essentially captures the meta-information about the function evalutaion. It's supposed to be information about the upcoming function information, and not information about the previous information.

I agree that it would be natural if it were like this, but at the moment this is definitely not the case, and it is not a matter of interpretation. Right now what the code does is that IterationType refers to what just happened, EvaluationType refers to the upcoming evaluation. We need to fix this, which means modifying Linesearch, Local() and minimize() so that they play well together. It will also help us learn how non-Linesearch minimizers should behave.

I think a single function evaluation is the right way to go. Two different functions seems like it would just create complicated state.

I agree, that's why I put this as a question, not as an issue.

A way to fix this is to have an EvalutaionType that is NoEvaluation (name tbd).

We already have NoEvaluation.

The Linesarch struct is performing the linsearch, sending new locations and MinorIteration. It concludes successfully (the previous point having been a MinorIteration), so now Linesearch sends a MajorIteration, as it would be. However, Linesearch doesn't actually need more information at that location; it already has it from the linesearch evaluation, so it sends the same x location and a NoEvaluation. Thus, checkConvergence() and Recorder are properly signaled when the MajorIteration started, but we don't waste additional function evaluations by evaluating things twice.

Good idea. Linesearch checks if the linesearch has concluded, it finds out that yes, it has concluded, and returns the reached location in xNext and MajorIteration, NoEvaluation. checkConvergence() and Record() are called, evaluate() does not evaluate anything, and Iterate() is called again. This time new direction is generated, xNext updated, and MinorIteration, xxxEvaluation returned. Sounds good.

from optimize.

btracey avatar btracey commented on July 2, 2024

We already have NoEvaluation.

Oops. Sorry, should have re-read the code.
The Linesarch struct is performing the linsearch, sending new locations and MinorIteration. It concludes successfully (the previous point having been a MinorIteration), so now Linesearch sends a MajorIteration, as it would be. However, Linesearch doesn't actually need more information at that location; it already has it from the linesearch evaluation, so it sends the same x location and a NoEvaluation. Thus, checkConvergence() and Recorder are properly signaled when the MajorIteration started, but we don't waste additional function evaluations by evaluating things twice.

Good idea. Linesearch checks if the linesearch has concluded, it finds out that yes, it has concluded, and returns the reached location in xNext and MajorIteration, NoEvaluation. checkConvergence() and Record() are called, evaluate() does not evaluate anything, and Iterate() is called again. This time new direction is generated, xNext updated, and MinorIteration, xxxEvaluation returned. Sounds good.

SGTM.

from optimize.

vladimir-ch avatar vladimir-ch commented on July 2, 2024

Resolved by 1ede5c9.

Closing.

from optimize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.