-
Notifications
You must be signed in to change notification settings - Fork 1.9k
RocketEngine fix for selecting top learners #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c79b01a
4dcb420
9ef8af1
179048b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,21 +196,10 @@ private TransformInference.SuggestedTransform[] SampleTransforms(RecipeInference | |
private RecipeInference.SuggestedRecipe.SuggestedLearner[] GetTopLearners(IEnumerable<PipelinePattern> history) | ||
{ | ||
var weights = LearnerHistoryToWeights(history.ToArray(), IsMaximizingMetric); | ||
var topKTuples = new Tuple<double, int>[_topK]; | ||
|
||
for (int i = 0; i < weights.Length; i++) | ||
{ | ||
if (i < _topK) | ||
topKTuples[i] = new Tuple<double, int>(weights[i], i); | ||
else | ||
{ | ||
for (int j = 0; j < topKTuples.Length; j++) | ||
if (weights[i] > topKTuples[j].Item1) | ||
topKTuples[j] = new Tuple<double, int>(weights[i], i); | ||
} | ||
} | ||
|
||
return topKTuples.Select(t => AvailableLearners[t.Item2]).ToArray(); | ||
return weights.Select((w, i) => new { Weight = w, Index = i }) | ||
.OrderByDescending(x => x.Weight) | ||
.Take(_topK) | ||
.Select(t=>AvailableLearners[t.Index]).ToArray(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ctrl-k-d to keep formatting up to date and whatnot There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Loading the file into Visual Studio and pressing ctrl+k+d has no effect. (I'm guessing that is already the "preferred" indentation?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tom probably talks about t=>AvailableLearners and want it to look like t => AvailableLearners. In reply to: 191921117 [](ancestors = 191921117) |
||
} | ||
|
||
public override PipelinePattern[] GetNextCandidates(IEnumerable<PipelinePattern> history, int numCandidates) | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Oh geez. :) Well thanks for finding and fixing!! #ByDesign