(self, batch, batch_idx)
| 1798 | return res |
| 1799 | |
| 1800 | def validation_step(self, batch, batch_idx): |
| 1801 | print('val step') |
| 1802 | print('batch_idx:', batch_idx) |
| 1803 | # if batch_idx != 0: |
| 1804 | # return |
| 1805 | |
| 1806 | if self.validation_count % 1 == 0 and self.trainer.current_epoch != 0: |
| 1807 | self.full_validation(batch) |
| 1808 | # else: |
| 1809 | # # pass |
| 1810 | # grid, all_samples, state = self.generate(batch, ddim_steps=self.ddim_steps, num_samples=3, limit=5) |
| 1811 | # metric, metric_list = self.get_eval_metric(all_samples, avg=self.eval_avg) |
| 1812 | # grid_imgs = Image.fromarray(grid.astype(np.uint8)) |
| 1813 | # # self.logger.log_image(key=f'samples_test', images=[grid_imgs]) |
| 1814 | # metric_dict = {f'val/{k}':v for k, v in zip(metric_list, metric)} |
| 1815 | # # self.logger.log_metrics(metric_dict) |
| 1816 | # if metric[-1] > self.run_full_validation_threshold: |
| 1817 | # self.full_validation(batch, state=state) |
| 1818 | self.validation_count += 1 |
| 1819 | |
| 1820 | |
| 1821 | def full_validation(self, batch, state=None): |
nothing calls this directly
no test coverage detected