MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / forward

Method forward

modules/sequence_modeling.py:48–62  ·  view source on GitHub ↗

input : visual feature [batch_size x T x input_size] output : contextual feature [batch_size x T x output_size]

(self, input)

Source from the content-addressed store, hash-verified

46 # self.c0 = torch.randn(2, 1, hidden_size).cuda()
47
48 def forward(self, input):
49 """
50 input : visual feature [batch_size x T x input_size]
51 output : contextual feature [batch_size x T x output_size]
52 """
53 self.rnn.flatten_parameters()
54 recurrent, _ = self.rnn(input) # batch_size x T x input_size -> batch_size x T x (2*hidden_size)
55 # T, b, h = recurrent.size()
56 # print("recurrent.size: ", recurrent.size())
57 # t_rec = recurrent.contiguous().view(T * b, h)
58
59 output = self.linear(recurrent) # batch_size x T x output_size
60 # output = output.view(T, b, -1)
61 # print("output.size: ", output.size())
62 return output
63
64class BidirectionalGRU(nn.Module):
65

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected