-
Notifications
You must be signed in to change notification settings - Fork 3
/
strategy.py
53 lines (34 loc) · 1.39 KB
/
strategy.py
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
def curriculum_strategy_gauss(iter_num,args):
if iter_num == 1600 or iter_num == 2400 or iter_num == 3200: # vgg alexnet
args.prior_batch = args.prior_batch * 2
if iter_num % args.gauss_t0 == 0 and args.std < 127:
args.std = args.std + args.gauss_gamma
if args.std > 127:
args.std = 127
return args
def curriculum_strategy_jigsaw(iter_num,args):
if iter_num == 1600 or iter_num==3200:
args.prior_batch = args.prior_batch*2
if iter_num % args.jigsaw_t0 == 0 and iter_num < args.jigsaw_end_iter:
args.fre = args.fre + args.jigsaw_gamma
return args
def curriculum_strategy_jigsaw_resnet152(iter_num,args):
if iter_num == 1600 or iter_num==3200:
args.prior_batch = args.prior_batch*2
if iter_num < 1000:
if iter_num % 200 == 0:
args.fre += 1
if iter_num >= 1000: # and iter_num <4200:
if iter_num % 400 == 0:
args.fre += 1
return args
def curriculum_strategy_jigsaw_googlenet(iter_num,args):
if iter_num == 1600 or iter_num == 2400 or iter_num == 3200:
args.prior_batch = args.prior_batch * 2
if iter_num <= 1200:
if iter_num % 400 == 0:
args.fre += 1
if iter_num > 1200: #and iter_num <= 3000:
if iter_num % 600 == 0:
args.fre += 1
return args