Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.

Conversation

btracey
Copy link
Member

@btracey btracey commented Feb 9, 2017

No description provided.

@btracey
Copy link
Member Author

btracey commented Feb 9, 2017

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?

@btracey
Copy link
Member Author

btracey commented Feb 9, 2017

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?

@btracey
Copy link
Member Author

btracey commented Feb 10, 2017

This doesn't record the initial optimization step.

return nil
}

// Full Recorder records all of the evaluations that occur during an optimization
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

FullRecorder

Copy link
Member Author

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:
Copy link
Member

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() {
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

field or fields

@btracey
Copy link
Member Author

btracey commented Apr 29, 2017

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).

@vladimir-ch
Copy link
Member

Closing because this repository is no longer maintained. Development has moved to https://github.com/gonum/gonum.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants