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
5748aefb
Unverified
Commit
5748aefb
authored
1 year ago
by
Nolan
Committed by
Yoann Schneider
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename teacher_forcing_scheduler to label_noise_scheduler
parent
6a749bed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dan/manager/training.py
+6
-6
6 additions, 6 deletions
dan/manager/training.py
dan/ocr/document/train.py
+1
-1
1 addition, 1 deletion
dan/ocr/document/train.py
docs/usage/train/parameters.md
+3
-3
3 additions, 3 deletions
docs/usage/train/parameters.md
tests/conftest.py
+1
-1
1 addition, 1 deletion
tests/conftest.py
with
11 additions
and
11 deletions
dan/manager/training.py
+
6
−
6
View file @
5748aefb
...
...
@@ -1116,26 +1116,26 @@ class Manager(OCRManager):
):
error_rate
=
self
.
params
[
"
training_params
"
][
"
teacher_forcing_error_rate
"
]
simulated_y_pred
,
y_len
=
self
.
add_label_noise
(
y
,
y_len
,
error_rate
)
elif
"
teacher_forcing
_scheduler
"
in
self
.
params
[
"
training_params
"
]:
elif
"
label_noise
_scheduler
"
in
self
.
params
[
"
training_params
"
]:
error_rate
=
(
self
.
params
[
"
training_params
"
][
"
teacher_forcing
_scheduler
"
][
self
.
params
[
"
training_params
"
][
"
label_noise
_scheduler
"
][
"
min_error_rate
"
]
+
min
(
self
.
latest_step
,
self
.
params
[
"
training_params
"
][
"
teacher_forcing
_scheduler
"
][
self
.
params
[
"
training_params
"
][
"
label_noise
_scheduler
"
][
"
total_num_steps
"
],
)
*
(
self
.
params
[
"
training_params
"
][
"
teacher_forcing
_scheduler
"
][
self
.
params
[
"
training_params
"
][
"
label_noise
_scheduler
"
][
"
max_error_rate
"
]
-
self
.
params
[
"
training_params
"
][
"
teacher_forcing
_scheduler
"
][
-
self
.
params
[
"
training_params
"
][
"
label_noise
_scheduler
"
][
"
min_error_rate
"
]
)
/
self
.
params
[
"
training_params
"
][
"
teacher_forcing
_scheduler
"
][
/
self
.
params
[
"
training_params
"
][
"
label_noise
_scheduler
"
][
"
total_num_steps
"
]
)
...
...
This diff is collapsed.
Click to expand it.
dan/ocr/document/train.py
+
1
−
1
View file @
5748aefb
...
...
@@ -223,7 +223,7 @@ def get_config():
"
force_cpu
"
:
False
,
# True for debug purposes
"
max_char_prediction
"
:
1000
,
# max number of token prediction
# Keep teacher forcing rate to 20% during whole training
"
teacher_forcing
_scheduler
"
:
{
"
label_noise
_scheduler
"
:
{
"
min_error_rate
"
:
0.2
,
"
max_error_rate
"
:
0.2
,
"
total_num_steps
"
:
5e4
,
...
...
This diff is collapsed.
Click to expand it.
docs/usage/train/parameters.md
+
3
−
3
View file @
5748aefb
...
...
@@ -270,9 +270,9 @@ The following configuration can be used by default. It must be defined in `datas
|
`training_params.train_metrics`
| List of metrics to compute during validation. |
`list`
|
`["cer", "wer", "wer_no_punct"]`
|
|
`training_params.force_cpu`
| Whether to train on CPU (for debugging). |
`bool`
|
`False`
|
|
`training_params.max_char_prediction`
| Maximum number of characters to predict. |
`int`
|
`1000`
|
|
`training_params.
teacher_forcing
_scheduler.min_error_rate`
| Minimum ratio of teacher forcing. |
`float`
|
`0.2`
|
|
`training_params.
teacher_forcing
_scheduler.max_error_rate`
| Maximum ratio of teacher forcing. |
`float`
|
`0.2`
|
|
`training_params.
teacher_forcing
_scheduler.total_num_steps`
| Number of steps before stopping teacher forcing. |
`float`
|
`5e4`
|
|
`training_params.
label_noise
_scheduler.min_error_rate`
| Minimum ratio of teacher forcing. |
`float`
|
`0.2`
|
|
`training_params.
label_noise
_scheduler.max_error_rate`
| Maximum ratio of teacher forcing. |
`float`
|
`0.2`
|
|
`training_params.
label_noise
_scheduler.total_num_steps`
| Number of steps before stopping teacher forcing. |
`float`
|
`5e4`
|
## MLFlow logging
...
...
This diff is collapsed.
Click to expand it.
tests/conftest.py
+
1
−
1
View file @
5748aefb
...
...
@@ -158,7 +158,7 @@ def training_config():
"
force_cpu
"
:
True
,
# True for debug purposes
"
max_char_prediction
"
:
30
,
# max number of token prediction
# Keep teacher forcing rate to 20% during whole training
"
teacher_forcing
_scheduler
"
:
{
"
label_noise
_scheduler
"
:
{
"
min_error_rate
"
:
0.2
,
"
max_error_rate
"
:
0.2
,
"
total_num_steps
"
:
5e4
,
...
...
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