MCPcopy Create free account
hub / github.com/AIRMEC/HECTOR / forward_attention

Method forward_attention

model.py:254–258  ·  view source on GitHub ↗
(self, h)

Source from the content-addressed store, hash-verified

252 module.bias.data.zero_()
253
254 def forward_attention(self, h):
255 A_ = self.attention_survival_net(h) # h shape is N_tilesxdim
256 A_raw = torch.transpose(A_, 1, 0) # K_attention_classesxN_tiles
257 A = F.softmax(A_raw, dim=-1) # #normalize attentions scores over tiles
258 return A_raw, A
259
260 def forward_fusion(self, h1, h2, h3):
261

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected