MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / ProjectReadout

Class ProjectReadout

ldm/modules/midas/midas/vit.py:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31class ProjectReadout(nn.Module):
32 def __init__(self, in_features, start_index=1):
33 super(ProjectReadout, self).__init__()
34 self.start_index = start_index
35
36 self.project = nn.Sequential(nn.Linear(2 * in_features, in_features), nn.GELU())
37
38 def forward(self, x):
39 readout = x[:, 0].unsqueeze(1).expand_as(x[:, self.start_index :])
40 features = torch.cat((x[:, self.start_index :], readout), -1)
41
42 return self.project(features)
43
44
45class Transpose(nn.Module):

Callers 1

get_readout_operFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected