forked from qiuqiangkong/dcase2019_task1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runme.sh
61 lines (42 loc) · 4.67 KB
/
runme.sh
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
#!/bin/bash
# You need to modify this path to your downloaded dataset directory
DATASET_DIR='/vol/vssp/datasets/audio/dcase2019/task1/dataset_root'
# You need to modify this path to your workspace to store features and models
WORKSPACE='/vol/vssp/msos/qk/workspaces/dcase2019_task1'
# Hyper-parameters
GPU_ID=1
MODEL_TYPE='Cnn_9layers_AvgPooling'
BATCH_SIZE=32
############ Train and validate on development dataset ############
# Calculate feature
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='a' --data_type='development' --workspace=$WORKSPACE
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='b' --data_type='development' --workspace=$WORKSPACE
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='c' --data_type='development' --workspace=$WORKSPACE
# Calculate scalar
python utils/features.py calculate_scalar --subtask='a' --data_type='development' --workspace=$WORKSPACE
python utils/features.py calculate_scalar --subtask='b' --data_type='development' --workspace=$WORKSPACE
python utils/features.py calculate_scalar --subtask='c' --data_type='development' --workspace=$WORKSPACE
# Subtask A
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='a' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_validation --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='a' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda
# Subtask B
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='b' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_validation --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='b' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda
# Subtask C
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='c' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_validation --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='c' --data_type='development' --holdout_fold=1 --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda
# Plot statistics
python utils/plot_results.py --workspace=$WORKSPACE --subtask=a
############ Train on full data without validation, inference on leaderboard and evaluation data ############
# Extract features for leaderboard data
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='a' --data_type='leaderboard' --workspace=$WORKSPACE
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='b' --data_type='leaderboard' --workspace=$WORKSPACE
python utils/features.py calculate_feature_for_all_audio_files --dataset_dir=$DATASET_DIR --subtask='c' --data_type='leaderboard' --workspace=$WORKSPACE
# Train on full data
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='a' --data_type='development' --holdout_fold='none' --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='b' --data_type='development' --holdout_fold='none' --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py train --dataset_dir=$DATASET_DIR --workspace=$WORKSPACE --subtask='c' --data_type='development' --holdout_fold='none' --model_type=$MODEL_TYPE --batch_size=$BATCH_SIZE --cuda
# Inference on leaderboard data
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_evaluation --workspace=$WORKSPACE --subtask='a' --data_type='leaderboard' --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_evaluation --workspace=$WORKSPACE --subtask='b' --data_type='leaderboard' --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda
CUDA_VISIBLE_DEVICES=$GPU_ID python pytorch/main.py inference_evaluation --workspace=$WORKSPACE --subtask='c' --data_type='leaderboard' --model_type=$MODEL_TYPE --iteration=5000 --batch_size=$BATCH_SIZE --cuda