Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
fb222870
Commit
fb222870
authored
1 year ago
by
Manon Blanco
Committed by
Yoann Schneider
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove coverage_vector from predict.py
parent
89f4bb6a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!132
Remove coverage_vector from predict.py
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
dan/predict/prediction.py
+0
-5
0 additions, 5 deletions
dan/predict/prediction.py
with
2 additions
and
6 deletions
README.md
+
2
−
1
View file @
fb222870
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
For more details about this package, make sure to see the documentation available at https://teklia.gitlab.io/atr/dan/.
For more details about this package, make sure to see the documentation available at https://teklia.gitlab.io/atr/dan/.
## Installation
## Installation
To use DAN in your own scripts, install it using pip:
To use DAN in your own scripts, install it using pip:
...
@@ -55,7 +54,9 @@ See the [dedicated section](https://teklia.gitlab.io/atr/dan/usage/datasets/form
...
@@ -55,7 +54,9 @@ See the [dedicated section](https://teklia.gitlab.io/atr/dan/usage/datasets/form
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/train/
)
on the official DAN documentation.
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/train/
)
on the official DAN documentation.
### Synthetic data generation
### Synthetic data generation
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/generate/
)
on the official DAN documentation.
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/generate/
)
on the official DAN documentation.
### Model prediction
### Model prediction
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/predict/
)
on the official DAN documentation.
See the
[
dedicated section
](
https://teklia.gitlab.io/atr/dan/usage/predict/
)
on the official DAN documentation.
This diff is collapsed.
Click to expand it.
dan/predict/prediction.py
+
0
−
5
View file @
fb222870
...
@@ -148,10 +148,6 @@ class DAN:
...
@@ -148,10 +148,6 @@ class DAN:
features
=
self
.
encoder
(
input_tensor
.
float
())
features
=
self
.
encoder
(
input_tensor
.
float
())
features_size
=
features
.
size
()
features_size
=
features
.
size
()
coverage_vector
=
torch
.
zeros
(
(
features
.
size
(
0
),
1
,
features
.
size
(
2
),
features
.
size
(
3
)),
device
=
self
.
device
,
)
pos_features
=
self
.
decoder
.
features_updater
.
get_pos_features
(
features
)
pos_features
=
self
.
decoder
.
features_updater
.
get_pos_features
(
features
)
features
=
torch
.
flatten
(
pos_features
,
start_dim
=
2
,
end_dim
=
3
).
permute
(
features
=
torch
.
flatten
(
pos_features
,
start_dim
=
2
,
end_dim
=
3
).
permute
(
2
,
0
,
1
2
,
0
,
1
...
@@ -179,7 +175,6 @@ class DAN:
...
@@ -179,7 +175,6 @@ class DAN:
confidence_scores
.
append
(
confidence_scores
.
append
(
torch
.
max
(
torch
.
softmax
(
pred
[:,
:],
dim
=
1
),
dim
=
1
).
values
torch
.
max
(
torch
.
softmax
(
pred
[:,
:],
dim
=
1
),
dim
=
1
).
values
)
)
coverage_vector
=
torch
.
clamp
(
coverage_vector
+
weights
,
0
,
1
)
predicted_tokens
=
torch
.
cat
(
predicted_tokens
=
torch
.
cat
(
[
[
predicted_tokens
,
predicted_tokens
,
...
...
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