@@ -97,9 +97,12 @@ def grid_graph(m, corners=False):
97
97
98
98
####training and testing models
99
99
print (L )
100
+
101
+ t_start = time .process_time ()
100
102
model_perf .test (models .cgcnn (config_TF , L , ** params ), name , params ,
101
103
train_data_perm , train_labels , val_data_perm , val_labels , test_data_perm , test_labels )
102
-
104
+ t_end_1 = time .process_time () - t_start
105
+ print ('Model {}; Execution time: {:.2f}s\n \n ' .format (name , t_end_1 ))
103
106
104
107
###model#2: one-layer convolution with fourier transform as filter
105
108
common ['regularization' ] = 0
@@ -117,8 +120,12 @@ def grid_graph(m, corners=False):
117
120
params ['dir_name' ] += name
118
121
params ['filter' ] = 'fourier'
119
122
params ['K' ] = [L [0 ].shape [0 ]]
120
- model_perf .test (models .cgcnn (config_TF ,L , ** params ), name , params ,
123
+
124
+ t_start = time .process_time ()
125
+ model_perf .test (models .cgcnn (config_TF , L , ** params ), name , params ,
121
126
train_data_perm , train_labels , val_data_perm , val_labels , test_data_perm , test_labels )
127
+ t_end_2 = time .process_time () - t_start
128
+ print ('Model {}; Execution time: {:.2f}s\n \n ' .format (name , t_end_2 ))
122
129
123
130
##model#3: one-layer convolution with chebyshev5 and b1relu as filters
124
131
name = 'cgconv_softmax'
@@ -127,8 +134,12 @@ def grid_graph(m, corners=False):
127
134
params ['filter' ] = 'chebyshev5'
128
135
# params['filter'] = 'chebyshev2'
129
136
# params['brelu'] = 'b2relu'
137
+
138
+ t_start = time .process_time ()
130
139
model_perf .test (models .cgcnn (config_TF ,L , ** params ), name , params ,
131
140
train_data_perm , train_labels , val_data_perm , val_labels , test_data_perm , test_labels )
141
+ t_end_3 = time .process_time () - t_start
142
+ print ('Model {}; Execution time: {:.2f}s\n \n ' .format (name , t_end_3 ))
132
143
133
144
##model#4: two convolutional layers with fourier transform as filters
134
145
common ['regularization' ] = 5e-4
@@ -151,7 +162,9 @@ def grid_graph(m, corners=False):
151
162
t_start = time .process_time ()
152
163
model_perf .test (models .cgcnn (config_TF ,L , ** params ), name , params ,
153
164
train_data_perm , train_labels , val_data_perm , val_labels , test_data_perm , test_labels )
154
- print ('Execution time: {:.2f}s' .format (time .process_time () - t_start ))
165
+ t_end_4 = time .process_time () - t_start
166
+ print ('Model {}; Execution time: {:.2f}s\n \n ' .format (name , t_end_4 ))
167
+
155
168
156
169
157
170
##model#5: two convolutional layers with Chebyshev polynomial as filters
@@ -165,8 +178,15 @@ def grid_graph(m, corners=False):
165
178
t_start = time .process_time ()
166
179
model_perf .test (models .cgcnn (config_TF ,L , ** params ), name , params ,
167
180
train_data_perm , train_labels , val_data_perm , val_labels , test_data_perm , test_labels )
168
- print ('Execution time: {:.2f}s' .format (time .process_time () - t_start ))
181
+ t_end_5 = time .process_time () - t_start
182
+ print ('Model {}; Execution time: {:.2f}s\n \n ' .format (name , t_end_5 ))
183
+
169
184
170
185
171
186
###summary
172
- model_perf .show ()
187
+ model_perf .show ()
188
+ print ('Execution time for model1: {:.2f}s\n \n ' .format (t_end_1 ))
189
+ print ('Execution time for model2: {:.2f}s\n \n ' .format (t_end_2 ))
190
+ print ('Execution time for model3: {:.2f}s\n \n ' .format (t_end_3 ))
191
+ print ('Execution time for model4: {:.2f}s\n \n ' .format (t_end_4 ))
192
+ print ('Execution time for model5: {:.2f}s\n \n ' .format (t_end_5 ))
0 commit comments