MCPcopy Create free account
hub / github.com/cure-lab/deep-active-learning / __init__

Method __init__

models/lossnet.py:11–25  ·  view source on GitHub ↗
(self, feature_sizes=[32, 16, 8, 4], 
                       num_channels=[64, 128, 256, 512], interm_dim=128)

Source from the content-addressed store, hash-verified

9# https://github.com/Mephisto405/Learning-Loss-for-Active-Learning
10class LossNet(nn.Module):
11 def __init__(self, feature_sizes=[32, 16, 8, 4],
12 num_channels=[64, 128, 256, 512], interm_dim=128):
13 super(LossNet, self).__init__()
14
15 self.GAP1 = nn.AvgPool2d(feature_sizes[0])
16 self.GAP2 = nn.AvgPool2d(feature_sizes[1])
17 self.GAP3 = nn.AvgPool2d(feature_sizes[2])
18 self.GAP4 = nn.AvgPool2d(feature_sizes[3])
19
20 self.FC1 = nn.Linear(num_channels[0], interm_dim)
21 self.FC2 = nn.Linear(num_channels[1], interm_dim)
22 self.FC3 = nn.Linear(num_channels[2], interm_dim)
23 self.FC4 = nn.Linear(num_channels[3], interm_dim)
24
25 self.linear = nn.Linear(4 * interm_dim, 1)
26
27 def forward(self, features,intermediate=False):
28 out1 = self.GAP1(features[0])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected