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

Class linMod

models/linear.py:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class linMod(nn.Module):
9 def __init__(self, dim, n_class):
10 super(linMod, self).__init__()
11 self.dim = dim
12 self.lm = nn.Linear(int(np.prod(dim)), n_class)
13 def forward(self, x):
14 x = x.view(-1, int(np.prod(self.dim)))
15 out = self.lm(x)
16 return out, x
17 def get_embedding_dim(self):
18 return int(np.prod(self.dim))
19
20# mlp model class
21class mlpMod(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected