MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / __init__

Method __init__

preprocess/auxiliary/AutoShot.py:250–270  ·  view source on GitHub ↗
(self,
                 in_channels,
                 inner_channels,
                 similarity_dim=128,
                 lookup_window=101,
                 output_dim=128,
                 stop_gradient=False,
                 use_bias=True)

Source from the content-addressed store, hash-verified

248class FrameSimilarity(nn.Module):
249
250 def __init__(self,
251 in_channels,
252 inner_channels,
253 similarity_dim=128,
254 lookup_window=101,
255 output_dim=128,
256 stop_gradient=False,
257 use_bias=True):
258 super(FrameSimilarity, self).__init__()
259
260 self.projection = Linear_(in_features=in_channels, out_features=similarity_dim,
261 bias=use_bias, act="Identity")
262 self.fc = Linear_(in_features=inner_channels, out_features=output_dim, bias=True, act="ReLU")
263
264 self.lookup_window = lookup_window
265 self.stop_gradient = stop_gradient
266 assert lookup_window % 2 == 1, "`lookup_window` must be odd integer"
267 if torch.cuda.is_available() is True:
268 self.device = "cuda"
269 else:
270 self.device = "cpu"
271
272 def forward(self, inputs):
273 # pt version [BS, C, N, H, W], so [3, 4] means apply avg on spatial dim, out dim is [BS, C, N]

Callers

nothing calls this directly

Calls 2

Linear_Class · 0.85
__init__Method · 0.45

Tested by

no test coverage detected