-
Notifications
You must be signed in to change notification settings - Fork 9
Add FullRecorder for logging an entire optimization #196
Conversation
I'm writing some personal code now to verify. I'm not sure "Read" is the function name. Maybe Read/RealAll as a parallel to csv? |
If we do change to Read/ReadAll, do we change the struct to also have an io.Reader? Do we make a different type entirely? |
This doesn't record the initial optimization step. |
return nil | ||
} | ||
|
||
// Full Recorder records all of the evaluations that occur during an optimization |
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.
Do you have a justification why this should be in optimize? The functionality seems quite specific to fit general needs.
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.
It seems specific? In what way? It seems like a natural counterpart to Printer. Printer prints to a writer to track optimization, this saves the optimization run to json
for retrospection
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.
I was thinking about what is being recorded and into what format. I can imagine that either will easily not fit the needs and the user will write it's own recorder.
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.
FullRecorder
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.
I understand your point about things being Ored and this not handling that properly. Do you have other suggestions for making it more general? It seems reasonable to me to provide some built-in way to store the history of the optimization for retrospection (in addition to the human-friendly printing we have now).
switch op { | ||
default: | ||
panic("optimize: unknown evaluation operation") | ||
case FuncEvaluation: |
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.
Evaluation operations can be ORed together which this switch does not take into account.
case op == MajorIteration || op == PostIteration: | ||
r.Loc = *loc | ||
} | ||
if op.isEvaluation() { |
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.
A left-over before the above switch was introduced?
return err | ||
} | ||
|
||
// Read reads the stream written to by FullRecorder, and returns the history of |
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.
written to r
?
return nil | ||
} | ||
|
||
// Full Recorder records all of the evaluations that occur during an optimization |
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.
FullRecorder
|
||
// Full Recorder records all of the evaluations that occur during an optimization | ||
// run. If Operation is an Evaulation, FullRecorder records the x location and | ||
// the corresponding field of Location. If Operation is a MajorIteration, or |
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.
field or fields
Okay, I think I see your point about Json being speciifc. Maybe the full recorder can just keep a list of the steps? That was the user can do something with them in memory, or save them using Json after the optimization has concluded (or whatever else). |
Closing because this repository is no longer maintained. Development has moved to https://github.com/gonum/gonum. |
No description provided.