Closed joewale closed 3 years ago
Hi there,
The norm stats are just the mean/std of the dataset, we calculate it using this script. Note that when we calculate the stats, the impact of mixup, SpecAug has already been considered, so you can see we input the audio_conf
to the dataloader, which contains mixup, SpecAug information.
-Yuan
Thanks for your quick reply. I have understand how to do. Another question: audio_conf I used should be the same as it used in pretrained model ? I use the pretrained model as follows: https://www.dropbox.com/s/cv4knew8mvbrnvq/audioset_0.4593.pth?dl=1
Hi there,
Only num_mel_bins
of audio_conf
needs to be the same as the pretrained model.
num_mel_bins
: must be 128 to use the pretrained model.
target_length
: no need/ should not be the same with the pretrained model, it should be the temporal frame length of your dataset, e.g., if your audios are 1s, target_length
should be 100.
freqm
and timem
: no need/should not be same with the pretrained model, we suggest to mask a reasonable portion, but not all your data, e.g., if your target_length
is 100, we suggest to set timem
with 24.
mixup
: no need/should not be the same with the pretrained model, depend if you want to use mixup for your training.
dataset
: should not be the same as the pretrained model, but notice this is used here and there in traintest.py
and run.py
for loss function/evaluation strategy flags, please take a look and make modifications.
mean
and std
: better to use the stats of your dataset, but it might be OK to just reuse the AudioSet stats.
noise
: depends on if you want to augment noise during training.
By the way, it is highly recommended to set audioset_pretrain=True
and set input_tdim
as your input length (in frames) when you initialize the AST model to use the pretrained model rather than manually use load_state_dict
because the first will automatically adjust the positional embeddings for your input length, which is important.
-Yuan
Thanks, I have a try by your good advice.
Hi, YuanGong, run.py中的norm_stats对于每个数据集的参数是怎么设置的?依据什么?