MCPcopy Create free account
hub / github.com/TencentARC/AnimeGamer / forward

Method forward

VDM_Decoder/diffusion_video.py:161–166  ·  view source on GitHub ↗
(self, x, batch)

Source from the content-addressed store, hash-verified

159 self.first_stage_model = model
160
161 def forward(self, x, batch): #CJH Here is to pass the loss function
162 # breakpoint()
163 loss = self.loss_fn(self.model, self.denoiser, self.conditioner, self.clip_img_encoder, x, batch)
164 loss_mean = loss.mean()
165 loss_dict = {"loss": loss_mean}
166 return loss_mean, loss_dict
167
168 def add_noise_to_first_frame(self, image):
169 sigma = torch.normal(mean=-3.0, std=0.5, size=(image.shape[0],)).to(self.device)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected