Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2Gluon
Commits
5f9884ec
Commit
5f9884ec
authored
Nov 07, 2019
by
Sebastian Nickels
Browse files
Fixed bugs im BeamSearch
parent
0072991d
Pipeline
#203328
failed with stages
in 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/main/resources/templates/gluon/execute.ftl
View file @
5f9884ec
...
...
@@ -59,7 +59,7 @@
sort(topk.begin(), topk.end(), [] (const pair<int, float>& p1, const pair<int, float>& p2) {
return p1.second > p2.second;
};
topk = vector<pair<int, float>>(topk.begin(), topk.begin() + min(k, topk.size()));
topk = vector<pair<int, float>>(topk.begin(), topk.begin() +
std::
min(k, topk.size()));
for (const pair<int, float>& pair : topk) {
vector<vector<float>> currentSeq = seq;
...
...
@@ -71,13 +71,13 @@
sort(allCandidates.begin(), allCandidates.end(), [] (const pair<vector<vector<float>>, double>& p1, const pair<vector<vector<float>>, double>& p2) {
return p1.second > p2.second;
});
sequences = vector<pair<vector<vector<float>>, double>>(allCandidates.begin(), allCandidates.begin() + min(k, allCandidates.size()));
sequences = vector<pair<vector<vector<float>>, double>>(allCandidates.begin(), allCandidates.begin() +
std::
min(k, allCandidates.size()));
}
for (size_t i = 1; i < ${tc.getBeamSearchMaxLength(networkInstruction)}; ++i) {
<#list tc.getUnrollOutputNames(networkInstruction, "i") as outputName>
<#if tc.getNameWithoutIndex(outputName) == tc.outputName>
${outputName} = sequences[0]
[0]
[i];
${outputName} = sequences[0]
.first
[i];
</#if>
</#list>
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment