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

Method forward

mogen/models/transformers/finemogen.py:160–180  ·  view source on GitHub ↗
(self, motion)

Source from the content-addressed store, hash-verified

158 self.body_out = nn.Linear(latent_dim, len(self.body_slice))
159
160 def forward(self, motion):
161 B, T = motion.shape[:2]
162 D = self.latent_dim
163 head_feat = self.head_out(motion[:, :, :D].contiguous())
164 stem_feat = self.stem_out(motion[:, :, D:2 * D].contiguous())
165 larm_feat = self.larm_out(motion[:, :, 2 * D:3 * D].contiguous())
166 rarm_feat = self.rarm_out(motion[:, :, 3 * D:4 * D].contiguous())
167 lleg_feat = self.lleg_out(motion[:, :, 4 * D:5 * D].contiguous())
168 rleg_feat = self.rleg_out(motion[:, :, 5 * D:6 * D].contiguous())
169 root_feat = self.root_out(motion[:, :, 6 * D:7 * D].contiguous())
170 body_feat = self.body_out(motion[:, :, 7 * D:].contiguous())
171 output = torch.zeros(B, T, self.output_dim).type_as(motion)
172 output[:, :, self.head_slice] = head_feat
173 output[:, :, self.stem_slice] = stem_feat
174 output[:, :, self.larm_slice] = larm_feat
175 output[:, :, self.rarm_slice] = rarm_feat
176 output[:, :, self.lleg_slice] = lleg_feat
177 output[:, :, self.rleg_slice] = rleg_feat
178 output[:, :, self.root_slice] = root_feat
179 output = (output + body_feat) / 2.0
180 return output
181
182
183class SFFN(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected