-
Notifications
You must be signed in to change notification settings - Fork 2
/
train_cifar10.sh
113 lines (103 loc) · 1.9 KB
/
train_cifar10.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
#!/bin/sh
t=0
# Representation train
CUDA_VISIBLE_DEVICES=0 \
python train.py \
--dataset cifar10 \
--model resnet18 \
--mode sup_simclr_CSI \
--batch_size 128 \
--epoch 700 \
--t $t \
--amp \
--lamb0 1.0 \
--lamb1 0.75
# Linear layer train
CUDA_VISIBLE_DEVICES=0 \
python train.py \
--mode sup_CSI_linear \
--dataset cifar10 \
--model resnet18 \
--batch_size 128 \
--epoch 100 \
--t $t
# ACCURACY & ECE
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode test_marginalized_acc \
--dataset cifar10 \
--model resnet18 \
--t $t \
--all_dataset \
--printfn 'til.txt'
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode cil \
--dataset cifar10 \
--model resnet18 \
--batch_size 128 \
--cil_task $t \
--all_dataset \
--printfn "cil results.txt"
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode cil_pre \
--dataset cifar10 \
--model resnet18 \
--batch_size 32 \
--cil_task $t \
--printfn "calibration.txt" \
--adaptation_lr 0.01 \
--weight_decay=0
for t in 1 2 3 4
do
# Representation train
CUDA_VISIBLE_DEVICES=0 \
python train.py \
--dataset cifar10 \
--model resnet18 \
--mode sup_simclr_CSI \
--batch_size 128 \
--epoch 700 \
--t $t \
--amp \
--lamb0 1.0 \
--lamb1 0.75
# linear layer train
CUDA_VISIBLE_DEVICES=0 \
python train.py \
--mode sup_CSI_linear \
--dataset cifar10 \
--model resnet18 \
--batch_size 128 \
--epoch 100 \
--t $t
# ACCURACY & ECE
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode test_marginalized_acc \
--dataset cifar10 \
--model resnet18 \
--t $t \
--all_dataset \
--printfn 'til.txt'
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode cil \
--dataset cifar10 \
--model resnet18 \
--batch_size 128 \
--cil_task $t \
--all_dataset \
--printfn "cil results.txt"
CUDA_VISIBLE_DEVICES=0 \
python eval.py \
--mode cil_pre \
--dataset cifar10 \
--model resnet18 \
--batch_size 32 \
--cil_task $t \
--printfn "calibration.txt" \
--adaptation_lr 0.01 \
--weight_decay=0
done