(self)
| 330 | torch.cuda.manual_seed_all(seed) |
| 331 | |
| 332 | def forward(self): |
| 333 | ## set random seed with current_step at each iteration |
| 334 | self._set_randomseed(self.randomseed_pool[self.tmp.current_step]) |
| 335 | |
| 336 | tmp = self.tmp |
| 337 | ginfo = self.ginfo |
| 338 | tmp.drop_this_iter = False |
| 339 | |
| 340 | output = self.model(tmp.input_var, tmp.current_step) |
| 341 | tmp.raw_loss = output['loss'] / ginfo.task_size |
| 342 | if 'top1' in output: |
| 343 | tmp.raw_top1 = output['top1'] / ginfo.task_size |
| 344 | else: |
| 345 | tmp.raw_top1 = torch.zeros(1).cuda() |
| 346 | tmp.loss = tmp.raw_loss * ginfo.task_weight |
| 347 | tmp.top1 = tmp.raw_top1 |
| 348 | |
| 349 | def backward(self): |
| 350 | tmp = self.tmp |
no test coverage detected