/
sample_run.sh
121 lines (119 loc) · 4.17 KB
/
sample_run.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
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
echo "Optional setting:"
echo "1) margin loss"
echo "2) proxy anchor loss"
echo "3) moco v2"
read -p "Please choose the setting (input the number): " setting
echo "Optional dataset:"
echo "1) cub200"
echo "2) cars196"
echo "3) online_products"
echo "4) imagenet"
read -p "Please choose the dataset (input the number): " dataset
case $setting in
1)
# margin loss
case $dataset in
1)
# cub200
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting margin --embeddings_dim 512 \
--margin_alpha 1 --margin_beta 0.5 --num_classes 100 \
--lr_trunk 0.00003 --lr_embedder 0.0003 --lr_loss 0.01 \
--dataset cub200 --delete_old
;;
2)
# cars196 # TODO:
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting margin --embeddings_dim 512 \
--margin_alpha 1 --margin_beta 0.5 --num_classes 98 \
--lr_trunk 0.00003 --lr_embedder 0.0003 --lr_loss 0.01 \
--dataset cars196 --delete_old
;;
3)
# online_products # TODO:
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting margin --embeddings_dim 512 \
--margin_alpha 1 --margin_beta 0.5 --num_classes 11318 \
--lr_trunk 0.00003 --lr_embedder 0.0003 --lr_loss 0.01 \
--dataset online_products --delete_old
;;
*)
echo No matched dataset!
esac
;;
2)
# proxy anchor loss
case $dataset in
1)
# cub200
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting proxy_anchor --embeddings_dim 512 \
--proxyanchor_margin 0.1 --proxyanchor_alpha 32 --num_classes 100 \
--wd 0.0001 --gamma 0.5 --step 10 \
--lr_trunk 0.0001 --lr_embedder 0.0001 --lr_collector 0.01 \
--dataset cub200 --delete_old \
--warm_up 1 --warm_up_list embedder collector
;;
2)
# cars196
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting proxy_anchor --embeddings_dim 512 \
--proxyanchor_margin 0.1 --proxyanchor_alpha 32 --num_classes 98 \
--wd 0.0001 --gamma 0.5 --step 20 \
--lr_trunk 0.0001 --lr_embedder 0.0001 --lr_collector 0.01 \
--dataset cars196 --delete_old \
--warm_up 1 --warm_up_list embedder collector
;;
3)
# online_products # TODO:
CUDA_VISIBLE_DEVICES=0 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--device 0 --batch_size 180 --test_batch_size 180 \
--setting proxy_anchor --embeddings_dim 512 \
--proxyanchor_margin 0.1 --proxyanchor_alpha 32 --num_classes 11318 \
--wd 0.0001 --gamma 0.5 --step 20 \
--lr_trunk 0.0001 --lr_embedder 0.0001 --lr_collector 0.01 \
--dataset online_products --delete_old \
--warm_up 1 --warm_up_list embedder collector
;;
*)
echo No matched dataset!
esac
;;
# proxy anchor loss
3)
case $dataset in
4)
# imagenet
CUDA_VISIBLE_DEVICES=0,1 python demo.py \
--data_path $WORKSPACE/datasets \
--save_path $WORKSPACE/exp/GeDML \
--save_name MoCov2 --splits_to_eval test --eval_exclude f1_score NMI AMI \
--device 0 1 --batch_size 256 --test_batch_size 500 \
--setting mocov2 --embeddings_dim 128 --moco_t 0.02 \
--lr_trunk 0.015 --lr_embedder 0.015 --T_max 200 \
--dataset imagenet --delete_old --is_distributed \
;;
*)
echo No matched dataset!
esac
;;
*)
echo No matched setting!
esac