MCPcopy Create free account
hub / github.com/TencentARC/MotionCtrl / validation_step

Method validation_step

lvdm/models/autoencoder.py:151–163  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

149 return discloss
150
151 def validation_step(self, batch, batch_idx):
152 inputs = self.get_input(batch, self.image_key)
153 reconstructions, posterior = self(inputs)
154 aeloss, log_dict_ae = self.loss(inputs, reconstructions, posterior, 0, self.global_step,
155 last_layer=self.get_last_layer(), split="val")
156
157 discloss, log_dict_disc = self.loss(inputs, reconstructions, posterior, 1, self.global_step,
158 last_layer=self.get_last_layer(), split="val")
159
160 self.log("val/rec_loss", log_dict_ae["val/rec_loss"])
161 self.log_dict(log_dict_ae)
162 self.log_dict(log_dict_disc)
163 return self.log_dict
164
165 def configure_optimizers(self):
166 lr = self.learning_rate

Callers

nothing calls this directly

Calls 2

get_inputMethod · 0.95
get_last_layerMethod · 0.95

Tested by

no test coverage detected