Spaces:
Running
on
Zero
Running
on
Zero
File size: 2,929 Bytes
b55d767 |
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
from pathlib import Path
from types import SimpleNamespace
from torchvision import transforms
from utmosv2.transform.xymasking import XYMasking
batch_size = 10
num_folds = 5
sr = 16000
preprocess = SimpleNamespace(
top_db=30, min_seconds=None, save_path=Path("preprocessed_data")
)
split = SimpleNamespace(
type="sgkf_kind",
target="mos",
group="sys_id",
kind="dataset",
)
external_data = "all"
use_bvcc = True
validation_dataset = "each"
dataset = SimpleNamespace(
name="multi_spec_ext",
specs=[
SimpleNamespace(
mode="melspec",
n_fft=4096,
hop_length=32,
win_length=4096,
n_mels=512,
shape=(512, 512),
norm=80,
),
SimpleNamespace(
mode="melspec",
n_fft=4096,
hop_length=32,
win_length=2048,
n_mels=512,
shape=(512, 512),
norm=80,
),
SimpleNamespace(
mode="melspec",
n_fft=4096,
hop_length=32,
win_length=1024,
n_mels=512,
shape=(512, 512),
norm=80,
),
SimpleNamespace(
mode="melspec",
n_fft=4096,
hop_length=32,
win_length=512,
n_mels=512,
shape=(512, 512),
norm=80,
),
],
spec_frames=SimpleNamespace(
num_frames=2, frame_sec=1.4, mixup_inner=True, mixup_alpha=0.4, extend="tile"
),
)
transform = dict(
train=transforms.Compose(
[
transforms.Resize((512, 512)),
XYMasking(
num_masks_x=(0, 2),
num_masks_y=(0, 2),
mask_x_length=(10, 40),
mask_y_length=(10, 30),
fill_value=0,
p=0.5,
),
# transforms.ToTensor(),
]
),
valid=transforms.Compose(
[
transforms.Resize((512, 512)),
# transforms.ToTensor()
]
),
)
loss = [
(SimpleNamespace(name="pairwize_diff", margin=0.2, norm="l1"), 0.7),
(SimpleNamespace(name="mse"), 0.2),
]
optimizer = SimpleNamespace(name="adamw", lr=1e-3, weight_decay=1e-4)
scheduler = SimpleNamespace(name="cosine", T_max=None, eta_min=1e-7)
model = SimpleNamespace(
name="multi_spec_ext",
multi_spec=SimpleNamespace(
backbone="tf_efficientnetv2_s.in21k_ft_in1k",
pretrained=True,
num_classes=1,
pool_type="catavgmax",
# feature_height=16,
atten=True,
# classifier=None,
),
)
run = SimpleNamespace(
mixup=True,
mixup_alpha=0.4,
num_epochs=20,
)
main_metric = "sys_srcc"
id_name = None
inference = SimpleNamespace(
save_path=Path("preds"),
submit_save_path=Path("submissions"),
num_tta=5,
batch_size=8,
extend="tile",
)
|