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

Method validation_step

code/dc_ldm/models/autoencoder.py:494–506  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

492 return discloss
493
494 def validation_step(self, batch, batch_idx):
495 inputs = self.get_input(batch, self.image_key)
496 reconstructions, posterior = self(inputs)
497 aeloss, log_dict_ae = self.loss(inputs, reconstructions, posterior, 0, self.global_step,
498 last_layer=self.get_last_layer(), split="val")
499
500 discloss, log_dict_disc = self.loss(inputs, reconstructions, posterior, 1, self.global_step,
501 last_layer=self.get_last_layer(), split="val")
502
503 self.log("val/rec_loss", log_dict_ae["val/rec_loss"])
504 self.log_dict(log_dict_ae)
505 self.log_dict(log_dict_disc)
506 return self.log_dict
507
508 def configure_optimizers(self):
509 lr = self.learning_rate

Callers

nothing calls this directly

Calls 3

get_inputMethod · 0.95
get_last_layerMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected