Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Merge requests
!8
Enhanced dependency parsing
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Enhanced dependency parsing
enhanced_dependency_parsing
into
develop
Overview
0
Commits
19
Pipelines
0
Changes
29
Merged
Mateusz Klimaszewski
requested to merge
enhanced_dependency_parsing
into
develop
4 years ago
Overview
0
Commits
19
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
826e57a7
Prev
Next
Show latest version
2 files
+
10
−
5
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
826e57a7
Hotfix off by one in enhanced graphs.
· 826e57a7
Mateusz Klimaszewski
authored
4 years ago
combo/models/graph_parser.py
+
3
−
3
Options
@@ -164,9 +164,9 @@ class GraphDependencyRelationModel(base.Predictor):
heads_true
:
torch
.
Tensor
,
mask
:
torch
.
BoolTensor
,
sample_weights
:
torch
.
Tensor
)
->
torch
.
Tensor
:
true
=
true
[
true
.
long
()
>
0
]
pred
=
pred
[
heads_true
.
long
()
==
1
]
correct_heads_mask
=
heads_true
.
long
()
==
1
true
=
true
[
correct_heads_mask
]
pred
=
pred
[
correct_heads_mask
]
loss
=
F
.
cross_entropy
(
pred
,
true
.
long
())
return
loss
.
sum
()
/
pred
.
size
(
0
)