MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / validation_step

Method validation_step

code/dc_ldm/models/diffusion/ddpm.py:1800–1818  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

full_validationMethod · 0.95

Tested by

no test coverage detected