MCPcopy Create free account
hub / github.com/akira-l/SEEG / PoseDecoderFC

Class PoseDecoderFC

scripts/model/embedding_net.py:85–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85class PoseDecoderFC(nn.Module):
86 def __init__(self, gen_length, pose_dim, use_pre_poses=False):
87 super().__init__()
88 self.gen_length = gen_length
89 self.pose_dim = pose_dim
90 self.use_pre_poses = use_pre_poses
91
92 in_size = 32
93 if use_pre_poses:
94 self.pre_pose_net = nn.Sequential(
95 nn.Linear(pose_dim * 4, 32),
96 nn.BatchNorm1d(32),
97 nn.ReLU(),
98 nn.Linear(32, 32),
99 )
100 in_size += 32
101
102 self.net = nn.Sequential(
103 nn.Linear(in_size, 128),
104 nn.BatchNorm1d(128),
105 nn.ReLU(),
106 nn.Linear(128, 128),
107 nn.BatchNorm1d(128),
108 nn.ReLU(),
109 nn.Linear(128, 256),
110 nn.BatchNorm1d(256),
111 nn.ReLU(),
112 nn.Linear(256, 512),
113 nn.BatchNorm1d(512),
114 nn.ReLU(),
115 nn.Linear(512, gen_length * pose_dim),
116 )
117
118 def forward(self, latent_code, pre_poses=None):
119 if self.use_pre_poses:
120 pre_pose_feat = self.pre_pose_net(pre_poses.reshape(pre_poses.shape[0], -1))
121 feat = torch.cat((pre_pose_feat, latent_code), dim=1)
122 else:
123 feat = latent_code
124 output = self.net(feat)
125 output = output.view(-1, self.gen_length, self.pose_dim)
126
127 return output
128
129
130class PoseDecoderGRU(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected