Comments (4)
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.
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.
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.
Resolved by 1ede5c9.
Closing.
from optimize.
Related Issues (20)
- Change from Function et al. interfaces + magic to input functions struct HOT 5
- Clearly define meaning of the various iteration types HOT 5
- Make optimize silent by default
- Method does not need ProblemInfo HOT 1
- LinesearchMethod.Iterate() is subtly wrong HOT 6
- Better name for ErrNonNegativeStepDirection
- Linesearchers should check function value before asking for gradient HOT 8
- Linesearchers should test function decrease to within a tolerance HOT 2
- Pass a copy of X to evaluation routines HOT 2
- Change the order of arguments for evaluation routines like Grad() and Hess()
- Remove Linesearcher.Finished()
- Change FunConst and GradConst to DecreaseFactor and CurvatureFactor
- [question] MajorIterations settings HOT 4
- optimize: curve-fitting - implement Levenberg-Marquardt algorithm (damped least-squares) HOT 7
- optimize: Add CMA-ES optimization algorithm HOT 3
- optimize: Repo description should not end with a "." HOT 4
- optimize: NewPrinter should accept an io.Writer HOT 1
- optimize: allow constrained optimization HOT 6
- Update of OptLoc on every iteration causes flaky optimization runs HOT 11
- Statuser docs are not accurate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimize.