Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CNNArch2Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
monticore
EmbeddedMontiArc
generators
CNNArch2Gluon
Commits
5f9884ec
Commit
5f9884ec
authored
5 years ago
by
Sebastian Nickels
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs im BeamSearch
parent
0072991d
No related branches found
No related tags found
1 merge request
!23
Added Unroll-related features and layers
Pipeline
#203328
failed
5 years ago
Stage: windows
Stage: linux
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/templates/gluon/execute.ftl
+3
-3
3 additions, 3 deletions
src/main/resources/templates/gluon/execute.ftl
with
3 additions
and
3 deletions
src/main/resources/templates/gluon/execute.ftl
+
3
−
3
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
>
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment