MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / __init__

Method __init__

text2motion/datasets/evaluator_models.py:268–282  ·  view source on GitHub ↗
(self, word_size, pos_size, hidden_size, device)

Source from the content-addressed store, hash-verified

266
267class TextEncoderBiGRU(nn.Module):
268 def __init__(self, word_size, pos_size, hidden_size, device):
269 super(TextEncoderBiGRU, self).__init__()
270 self.device = device
271
272 self.pos_emb = nn.Linear(pos_size, word_size)
273 self.input_emb = nn.Linear(word_size, hidden_size)
274 self.gru = nn.GRU(hidden_size, hidden_size, batch_first=True, bidirectional=True)
275 # self.linear2 = nn.Linear(hidden_size, output_size)
276
277 self.input_emb.apply(init_weight)
278 self.pos_emb.apply(init_weight)
279 # self.linear2.apply(init_weight)
280 # self.batch_size = batch_size
281 self.hidden_size = hidden_size
282 self.hidden = nn.Parameter(torch.randn((2, 1, self.hidden_size), requires_grad=True))
283
284 # input(batch_size, seq_len, dim)
285 def forward(self, word_embs, pos_onehot, cap_lens):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected