forked from facebookresearch/fairseq
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from chorowski-lab/gcie/metrics
Add alignment metrics
- Loading branch information
Showing
4 changed files
with
143 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# @package _group_ | ||
|
||
common: | ||
fp16: false | ||
log_format: json | ||
log_interval: 20 | ||
tensorboard_logdir: tensorboard | ||
|
||
checkpoint: | ||
keep_last_epochs: 3 | ||
|
||
task: | ||
_name: scribblelens | ||
data: /pio/scratch/2/jch/wav2vec/data/scribblelens | ||
vocab_path: '${env:PWD}/fairseq/data/handwriting/tasman.alphabet.plus.space.mode5.json' | ||
enable_padding: True | ||
pad_to_multiples_of: 4 | ||
max_sample_size: 250000 | ||
min_sample_size: 32000 | ||
normalize: false | ||
labels: True | ||
|
||
dataset: | ||
num_workers: 0 | ||
max_tokens: 10000 | ||
skip_invalid_size_inputs_valid_test: true | ||
valid_subset: test | ||
|
||
distributed_training: | ||
distributed_world_size: 1 | ||
ddp_backend: no_c10d | ||
|
||
criterion: | ||
_name: wav2vec | ||
infonce: true | ||
log_keys: ["prob_perplexity","code_perplexity","temp", "adjusted_mutual_info","normalized_mutual_info","adjusted_rand_score"] | ||
loss_weights: [0.1, 10] | ||
|
||
optimization: | ||
max_update: 400000 | ||
lr: [0.0003] | ||
|
||
optimizer: | ||
_name: adam | ||
adam_betas: (0.9,0.98) | ||
adam_eps: 1e-06 | ||
weight_decay: 0.01 | ||
|
||
lr_scheduler: | ||
_name: polynomial_decay | ||
warmup_updates: 20000 | ||
|
||
model: | ||
_name: wav2vec2_scribblelens | ||
conv_feature_layers: '[(64, (3, 3), (1, 2), (1, 1)), (128, (5, 5), (2, 2), (2, 2)), (256, (3,3), (1, 1), (1, 1)), (256, (3,3), (1, 2), (1, 1)), (512, (3,3), (1, 1), (1, 1)), (512, (3,3), (1, 2), (1, 1)), (512, (3,2), (2, 1), (1, 0))]' | ||
quantize_targets: true | ||
final_dim: 256 | ||
encoder_embed_dim: 768 | ||
|
||
encoder_layerdrop: 0.05 | ||
dropout: 0.1 | ||
attention_dropout: 0.1 | ||
dropout_input: 0.1 | ||
dropout_features: 0.1 | ||
feature_grad_mult: 0.1 | ||
|
||
latent_vars: 320 | ||
latent_groups: 2 | ||
latent_temp: [2,0.5,0.999995] | ||
|
||
compute_alignment_metrics: true | ||
|
||
probe_defs: | ||
post_extract_proj_mlp: | ||
cls: Conv1DProbe | ||
module_name: post_extract_proj | ||
layer_dims: [768, 512, 73] | ||
kernel_size: 3 | ||
output_selector: 'lambda x: {"output": x.transpose(1, 2)}' | ||
target_selector: 'lambda x: {"target":x["alignments"], "padding_mask": x["net_input"].get("padding_mask")}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
python train.py --distributed-world-size 1 --update-freq 2 \ | ||
/pio/scratch/1/i283340/MGR/NewSetup/DistSup/data \ | ||
--save-dir /pio/scratch/1/i290956/try_sl2 --num-workers 0 \ | ||
--keep-last-epochs 3 \ | ||
--tensorboard-logdir /pio/scratch/1/i290956/runs/try_sl2 --log-format simple \ | ||
--task scribblelens --criterion wav2vec --arch wav2vec2_scribblelens \ | ||
--valid-subset test --pad-to-multiples-of 4 `#--max-sample-size 256` \ | ||
--log-keys '["prob_perplexity","code_perplexity","temp","adjusted_mutual_info","normalized_mutual_info","adjusted_rand_score"]' --quantize-targets --extractor-mode default \ | ||
--conv-feature-layers '[(64, (3, 3), (1, 2), (1, 1)), (128, (5, 5), (2, 2), (2, 2)), (256, (3,3), (1, 1), (1, 1)), (256, (3,3), (1, 2), (1, 1)), (512, (3,3), (1, 1), (1, 1)), (512, (3,3), (1, 2), (1, 1)), (512, (3,2), (2, 1), (1, 0))]' \ | ||
--final-dim 256 \ | ||
--latent-vars 320 --latent-groups 2 --latent-temp '(2,0.5,0.999995)' --infonce \ | ||
--optimizer adam --adam-betas '(0.9,0.98)' --adam-eps 1e-06 --lr-scheduler polynomial_decay \ | ||
--total-num-update 400000 --lr 0.0005 --warmup-updates 32000 \ | ||
--mask-length 10 --mask-prob 0.65 --mask-selection static --mask-other 0 \ | ||
--encoder-layerdrop 0.05 --dropout-input 0.1 --dropout-features 0.1 --feature-grad-mult 0.1 \ | ||
--loss-weights '[0.1, 10]' --conv-pos 128 --conv-pos-groups 16 \ | ||
--num-negatives 100 --cross-sample-negatives 0 \ | ||
`#--max-sample-size 250000 --min-sample-size 32000` \ | ||
--dropout 0.1 --attention-dropout 0.1 --weight-decay 0.01 --max-tokens 10000 --max-update 400000 \ | ||
--skip-invalid-size-inputs-valid-test --ddp-backend no_c10d \ | ||
--labels "a" \ | ||
--enable-padding # crashes without that, needs to make all lines same-size | ||
|