File size: 2,162 Bytes
4097db2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Multimodal theme classification (classification/classify.py)
# 5-fold CV; for every modality combination every grid configuration is trained in every fold,
# the one with the best inner-validation macro-F1 is chosen, and its test macro-F1 is reported.
# Override any value from the command line, e.g.
# python classification/classify.py --set data.lyrics=lyrics_phasea --set output_dir=results/classification/phasea
data:
metadata: data/multimodal/metadata.csv # songs, labels, 'fold', 'lyrics_group'
embeddings: data/multimodal/embeddings.npz # vocal / instrument / mix + lyrics variants
lyrics: lyrics_phaseb_cv # lyrics_phaseb_cv: Phase B model trained without the test fold
# lyrics_phasea: Phase A (TSDAE) model, never saw a label
output_dir: results/classification/phaseb
modalities: [lyrics, vocal, instrument, mix]
combos: all # all = every non-empty subset (15); or a list, e.g. [lyrics, lyrics+vocal]
folds: all # all, or a list of fold ids, e.g. [0]
seed: 42
inner_val_splits: 6 # 1/6 of the non-test songs form the validation split of each fold
late_fusion: true # also score the average of the best single-modality models
training:
max_epochs: 60
min_epochs: 10 # never stop before this
patience: 10 # epochs without a validation gain > min_delta
min_delta: 0.001
lr_scheduler_patience: 5 # ReduceLROnPlateau on validation macro-F1, factor 0.5
batch_size: 64
weight_decay: 0.0001
model:
d_model: 256 # width of every modality projection
dropout: 0.3
attention_heads: 4 # xattn
aux_loss_weight: 0.5 # weight of the per-modality auxiliary losses (aux: true)
grid:
methods: [mlp, gmu, xattn] # for combinations of 2+ modalities
single_modality_methods: [mlp, xattn] # xattn only for single audio modalities
lr: [0.0001, 0.0003]
soft_labels: [false, true] # train on final_* soft scores instead of the label
modality_dropout: [0.0, 0.3] # 2+ modalities only
aux_loss: [false, true] # mlp / gmu with 2+ modalities only
|