@@ -146,14 +146,14 @@ def _forward_oneQ_batch(self, samp_batch):
146
146
147
147
return output_vec, where 1st col is predicted time
148
148
'''
149
- #print(samp_batch)
149
+ # print(samp_batch)
150
150
feat_vec = samp_batch ['feat_vec' ]
151
151
# print(samp_batch['real_node_type'])
152
152
153
153
# print(samp_batch['node_type'])
154
154
# print(feat_vec.shape, print(samp_batch['children_plan']))
155
155
input_vec = torch .from_numpy (feat_vec ).to (self .device )
156
- #print(samp_batch['node_type'], input_vec)
156
+ # print(samp_batch['node_type'], input_vec)
157
157
subplans_time = []
158
158
for child_plan_dict in samp_batch ['children_plan' ]:
159
159
child_output_vec , _ = self ._forward_oneQ_batch (child_plan_dict )
@@ -176,15 +176,16 @@ def _forward_oneQ_batch(self, samp_batch):
176
176
# pred_time assumed to be the first col
177
177
178
178
cat_res = torch .cat ([pred_time ] + subplans_time , axis = 1 )
179
- #print("cat_res.shape", cat_res.shape)
179
+ # print("cat_res.shape", cat_res.shape)
180
180
pred_time = torch .sum (cat_res , 1 )
181
- #print("pred_time.shape", pred_time.shape)
182
- if self .test_time :
183
- print (samp_batch ['node_type' ], pred_time , samp_batch ['total_time' ])
181
+ # print("pred_time.shape", pred_time.shape)
182
+
183
+ # if self.test_time:
184
+ # print(samp_batch['node_type'], pred_time, samp_batch['total_time'])
184
185
185
186
loss = (pred_time -
186
187
torch .from_numpy (samp_batch ['total_time' ]).to (self .device )) ** 2
187
- #print("loss.shape", loss.shape)
188
+ # print("loss.shape", loss.shape)
188
189
self .acc_loss [samp_batch ['node_type' ]].append (loss )
189
190
190
191
# added to deal with NaN
0 commit comments