MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / _validation_step

Method _validation_step

ldm/models/autoencoder.py:144–156  ·  view source on GitHub ↗
(self, batch, batch_idx, postfix="")

Source from the content-addressed store, hash-verified

142 return log_dict
143
144 def _validation_step(self, batch, batch_idx, postfix=""):
145 inputs = self.get_input(batch, self.image_key)
146 reconstructions, posterior = self(inputs)
147 aeloss, log_dict_ae = self.loss(inputs, reconstructions, posterior, 0, self.global_step,
148 last_layer=self.get_last_layer(), split="val"+postfix)
149
150 discloss, log_dict_disc = self.loss(inputs, reconstructions, posterior, 1, self.global_step,
151 last_layer=self.get_last_layer(), split="val"+postfix)
152
153 self.log(f"val{postfix}/rec_loss", log_dict_ae[f"val{postfix}/rec_loss"])
154 self.log_dict(log_dict_ae)
155 self.log_dict(log_dict_disc)
156 return self.log_dict
157
158 def configure_optimizers(self):
159 lr = self.learning_rate

Callers 1

validation_stepMethod · 0.95

Calls 2

get_inputMethod · 0.95
get_last_layerMethod · 0.95

Tested by

no test coverage detected