MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / compute_loss

Method compute_loss

mogen/models/transformers/intergen.py:144–156  ·  view source on GitHub ↗
(self, batch)

Source from the content-addressed store, hash-verified

142 self.load_pretrained(init_cfg['checkpoint'])
143
144 def compute_loss(self, batch):
145 losses = {}
146 losses["total"] = 0
147
148 # compute clip losses
149 batch = self.encode_text(batch)
150 batch = self.encode_motion(batch)
151
152 mixed_clip_loss, clip_losses = self.compute_clip_losses(batch)
153 losses.update(clip_losses)
154 losses["total"] += mixed_clip_loss
155
156 return losses["total"], losses
157
158 def generate_src_mask(self, T, length):
159 B = length.shape[0]

Callers

nothing calls this directly

Calls 2

encode_textMethod · 0.95
encode_motionMethod · 0.95

Tested by

no test coverage detected