-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresults.py
101 lines (71 loc) · 6.59 KB
/
results.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
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
import numpy as np
import os
import copy
import threading
import argparse
################################################
def get_perms(param):
params = [param]
for key in param.keys():
val = param[key]
if type(val) == list:
new_params = []
for ii in range(len(val)):
for jj in range(len(params)):
new_param = copy.copy(params[jj])
new_param[key] = val[ii]
new_params.append(new_param)
params = new_params
return params
################################################
# FC
################################################
mnist_fc_bp = {'benchmark':'mnist_fc.py', 'epochs':300, 'batch_size':32, 'lr':[0.01], 'eps':[1.], 'act':['relu'], 'bias':[0.0], 'dropout':[0.0], 'dfa':0, 'sparse':0, 'rank':0, 'init':'glorot_uniform', 'load':None}
mnist_fc_dfa = {'benchmark':'mnist_fc.py', 'epochs':300, 'batch_size':32, 'lr':[0.01], 'eps':[1.], 'act':['tanh'], 'bias':[0.0], 'dropout':[0.0], 'dfa':1, 'sparse':0, 'rank':0, 'init':'zero', 'load':None}
mnist_fc_sparse = {'benchmark':'mnist_fc.py', 'epochs':300, 'batch_size':32, 'lr':[0.01], 'eps':[1.], 'act':['tanh'], 'bias':[0.0], 'dropout':[0.0], 'dfa':1, 'sparse':1, 'rank':0, 'init':'zero', 'load':None}
cifar10_fc_bp = {'benchmark':'cifar10_fc.py', 'epochs':300, 'batch_size':64, 'lr':[3e-5], 'eps':[1e-6], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':0, 'sparse':0, 'rank':0, 'init':'sqrt_fan_in', 'load':None}
cifar10_fc_dfa = {'benchmark':'cifar10_fc.py', 'epochs':300, 'batch_size':64, 'lr':[1e-4], 'eps':[1e-6], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':0, 'rank':0, 'init':'zero', 'load':None}
cifar10_fc_sparse = {'benchmark':'cifar10_fc.py', 'epochs':500, 'batch_size':64, 'lr':[1e-4], 'eps':[1e-4], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':1, 'rank':0, 'init':'zero', 'load':None}
cifar100_fc_bp = {'benchmark':'cifar100_fc.py', 'epochs':300, 'batch_size':64, 'lr':[1e-5], 'eps':[1e-4], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':0, 'sparse':[0], 'rank':0, 'init':'sqrt_fan_in', 'load':None}
cifar100_fc_dfa = {'benchmark':'cifar100_fc.py', 'epochs':300, 'batch_size':64, 'lr':[3e-5], 'eps':[1e-6], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':[0], 'rank':0, 'init':'zero', 'load':None}
cifar100_fc_sparse = {'benchmark':'cifar100_fc.py', 'epochs':500, 'batch_size':64, 'lr':[3e-5], 'eps':[1e-5], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':[1], 'rank':0, 'init':'zero', 'load':None}
################################################
# CONV
################################################
mnist_conv_bp = {'benchmark':'mnist_conv.py', 'epochs':300, 'batch_size':64, 'lr':[0.005], 'eps':[1.], 'act':['relu'], 'bias':[0.0], 'dropout':[0.25], 'dfa':0, 'sparse':0, 'rank':0, 'init':'glorot_uniform', 'load':None}
mnist_conv_dfa = {'benchmark':'mnist_conv.py', 'epochs':300, 'batch_size':64, 'lr':[0.01], 'eps':[1.], 'act':['tanh'], 'bias':[0.0], 'dropout':[0.25], 'dfa':1, 'sparse':0, 'rank':0, 'init':'zero', 'load':None}
mnist_conv_sparse = {'benchmark':'mnist_conv.py', 'epochs':300, 'batch_size':64, 'lr':[0.01], 'eps':[1.], 'act':['tanh'], 'bias':[0.0], 'dropout':[0.25], 'dfa':1, 'sparse':1, 'rank':0, 'init':'zero', 'load':None}
cifar10_conv_bp = {'benchmark':'cifar10_conv.py', 'epochs':100, 'batch_size':64, 'lr':[1e-4], 'eps':[1e-4], 'act':['relu'], 'bias':[0.1], 'dropout':[0.50], 'dfa':0, 'sparse':0, 'rank':0, 'init':'glorot_uniform', 'load':None}
cifar10_conv_dfa = {'benchmark':'cifar10_conv.py', 'epochs':500, 'batch_size':64, 'lr':[3e-5], 'eps':[3e-5], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':0, 'rank':0, 'init':'zero', 'load':None}
cifar10_conv_sparse = {'benchmark':'cifar10_conv.py', 'epochs':500, 'batch_size':64, 'lr':[1e-5], 'eps':[3e-5], 'act':['relu'], 'bias':[0.1], 'dropout':[0.25], 'dfa':1, 'sparse':1, 'rank':0, 'init':'zero', 'load':None}
cifar100_conv_bp = {'benchmark':'cifar100_conv.py', 'epochs':100, 'batch_size':64, 'lr':[1e-5], 'eps':[1e-5], 'act':['relu'], 'bias':[0.0], 'dropout':[0.50], 'dfa':0, 'sparse':0, 'rank':0, 'init':'glorot_uniform', 'load':None}
cifar100_conv_dfa = {'benchmark':'cifar100_conv.py', 'epochs':100, 'batch_size':64, 'lr':[1e-5], 'eps':[1e-5], 'act':['tanh'], 'bias':[0.0], 'dropout':[0.25], 'dfa':1, 'sparse':0, 'rank':0, 'init':'zero', 'load':None}
cifar100_conv_sparse = {'benchmark':'cifar100_conv.py', 'epochs':200, 'batch_size':64, 'lr':[1e-5], 'eps':[1e-5], 'act':['tanh'], 'bias':[0.1], 'dropout':[0.1], 'dfa':1, 'sparse':1, 'rank':0, 'init':'zero', 'load':None}
################################################
# vgg
################################################
# use act=tanh, bias=0
# use act=relu, bias=1
imagenet_vgg_bp = {'benchmark':'imagenet_vgg.py', 'epochs':10, 'batch_size':32, 'lr':[1e-2], 'eps':[1.], 'act':['tanh'], 'bias':[0.], 'dropout':[0.5], 'dfa':0, 'sparse':0, 'rank':0, 'init':['alexnet'], 'load':None}
imagenet_vgg_dfa = {'benchmark':'imagenet_vgg.py', 'epochs':1000, 'batch_size':32, 'lr':[1e-2], 'eps':[1.01], 'act':['tanh'], 'bias':[0.], 'dropout':[0.5], 'dfa':1, 'sparse':0, 'rank':0, 'init':['zero'], 'load':None}
imagenet_vgg_sparse1 = {'benchmark':'vgg_fc.py', 'epochs':100, 'batch_size':64, 'lr':[0.05], 'eps':[1.], 'act':['tanh'], 'bias':[0.], 'dropout':[0.5], 'dfa':1, 'sparse':1, 'rank':0, 'init':['zero'], 'load':None}
imagenet_vgg_sparse2 = {'benchmark':'vgg_fc.py', 'epochs':100, 'batch_size':32, 'lr':[0.0001], 'eps':[1.], 'act':['relu'], 'bias':[1.], 'dropout':[0.1], 'dfa':1, 'sparse':1, 'rank':0, 'init':['zero'], 'load':None}
imagenet_vgg_sparse3 = {'benchmark':'vgg_fc.py', 'epochs':100, 'batch_size':32, 'lr':[0.0001], 'eps':[1.], 'act':['relu'], 'bias':[1.], 'dropout':[0.25], 'dfa':1, 'sparse':1, 'rank':0, 'init':['zero'], 'load':None}
################################################
mnist_fc = [mnist_fc_bp, mnist_fc_dfa, mnist_fc_sparse]
cifar10_fc = [cifar10_fc_bp, cifar10_fc_dfa, cifar10_fc_sparse]
cifar100_fc = [cifar100_fc_bp, cifar100_fc_dfa, cifar100_fc_sparse]
mnist_conv = [mnist_conv_bp, mnist_conv_dfa, mnist_conv_sparse]
cifar10_conv = [cifar10_conv_bp, cifar10_conv_dfa, cifar10_conv_sparse]
cifar100_conv = [cifar100_conv_bp, cifar100_conv_dfa, cifar100_conv_sparse]
fc = mnist_fc + cifar10_fc + cifar100_fc
conv = mnist_conv + cifar10_conv + cifar100_conv
params = conv
################################################
def get_runs():
runs = []
for param in params:
perms = get_perms(param)
runs.extend(perms)
return runs
################################################