MCPcopy Create free account
hub / github.com/GuyTevet/motion-diffusion-model / forward

Method forward

model/mdm.py:372–386  ·  view source on GitHub ↗
(self, output)

Source from the content-addressed store, hash-verified

370 self.velFinal = nn.Linear(self.latent_dim, self.input_feats)
371
372 def forward(self, output):
373 nframes, bs, d = output.shape
374 if self.data_rep in ['rot6d', 'xyz', 'hml_vec']:
375 output = self.poseFinal(output) # [seqlen, bs, 150]
376 elif self.data_rep == 'rot_vel':
377 first_pose = output[[0]] # [1, bs, d]
378 first_pose = self.poseFinal(first_pose) # [1, bs, 150]
379 vel = output[1:] # [seqlen-1, bs, d]
380 vel = self.velFinal(vel) # [seqlen-1, bs, 150]
381 output = torch.cat((first_pose, vel), axis=0) # [seqlen, bs, 150]
382 else:
383 raise ValueError
384 output = output.reshape(nframes, bs, self.njoints, self.nfeats)
385 output = output.permute(1, 2, 3, 0) # [bs, njoints, nfeats, nframes]
386 return output
387
388
389class EmbedAction(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected