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
Commits
cd660089
Commit
cd660089
authored
3 years ago
by
Mateusz Klimaszewski
Browse files
Options
Downloads
Patches
Plain Diff
Enable BERT fine-tuning.
parent
e902b504
Branches
Branches containing commit
No related merge requests found
Pipeline
#2898
passed with stage
in 3 minutes and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
combo/config.graph.template.jsonnet
+8
-2
8 additions, 2 deletions
combo/config.graph.template.jsonnet
combo/training/scheduler.py
+2
-1
2 additions, 1 deletion
combo/training/scheduler.py
scripts/train_iwpt21.py
+2
-2
2 additions, 2 deletions
scripts/train_iwpt21.py
with
12 additions
and
5 deletions
combo/config.graph.template.jsonnet
+
8
−
2
View file @
cd660089
...
...
@@ -202,6 +202,7 @@ assert pretrained_tokens == null || pretrained_transformer_name == null: "Can't
},
token
:
if
use_transformer
then
{
type
:
"transformers_word_embeddings"
,
freeze_transformer
:
false
,
model_name
:
pretrained_transformer_name
,
projection_dim
:
projected_embedding_dim
,
tokenizer_kwargs
:
if
std
.
startsWith
(
pretrained_transformer_name
,
"allegro/herbert"
)
...
...
@@ -401,9 +402,14 @@ assert pretrained_tokens == null || pretrained_transformer_name == null: "Can't
grad_clipping
:
5.0
,
num_epochs
:
num_epochs
,
optimizer
:
{
type
:
"adam"
,
type
:
"adam
w
"
,
lr
:
learning_rate
,
betas
:
[
0.9
,
0.9
],
weight_decay
:
0.0
,
parameter_groups
:
[
[
[
'_embedder'
],
{
lr
:
5e-5
,
weight_decay
:
0.01
,
finetune
:
true
,
},
],
],
},
patience
:
1
,
# it will be overwriten by callback
epoch_callbacks
:
[
...
...
This diff is collapsed.
Click to expand it.
combo/training/scheduler.py
+
2
−
1
View file @
cd660089
...
...
@@ -7,7 +7,8 @@ from overrides import overrides
class
Scheduler
(
learning_rate_scheduler
.
_PyTorchLearningRateSchedulerWrapper
):
def
__init__
(
self
,
optimizer
,
patience
:
int
=
6
,
decreases
:
int
=
2
,
threshold
:
float
=
1e-3
):
super
().
__init__
(
lr_scheduler
.
LambdaLR
(
optimizer
,
lr_lambda
=
[
self
.
_lr_lambda
]))
super
().
__init__
(
lr_scheduler
.
LambdaLR
(
optimizer
,
lr_lambda
=
[
self
.
_lr_lambda
]
*
len
(
optimizer
.
param_groups
)))
self
.
threshold
=
threshold
self
.
decreases
=
decreases
self
.
patience
=
patience
...
...
This diff is collapsed.
Click to expand it.
scripts/train_iwpt21.py
+
2
−
2
View file @
cd660089
...
...
@@ -114,8 +114,8 @@ def run(_):
--pretrained_transformer_name
{
utils
.
LANG2TRANSFORMER
[
lang
]
}
--serialization_dir
{
serialization_dir
}
--cuda_device
{
FLAGS
.
cuda_device
}
--word_batch_size
25
00
--config_path
{
pathlib
.
Path
.
cwd
()
/
'
config.graph.template.jsonnet
'
}
--word_batch_size
10
00
--config_path
{
pathlib
.
Path
.
cwd
()
/
'
combo
'
/
'
config.graph.template.jsonnet
'
}
--notensorboard
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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