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

Class LeNet

models/linear.py:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96# net
97class LeNet(nn.Module):
98 def __init__(self, n_class=10, bayesian=False):
99 super(LeNet, self).__init__()
100 self.feature_extractor = Net1_fea()
101 self.linear = Net1_clf(n_class)
102 self.discriminator = Net1_dis()
103 self.bayesian = bayesian
104
105 def forward(self, x, intermediate=False):
106 x, in_values = self.feature_extractor(x)
107 x = F.dropout(x, p=0.2, training=self.bayesian)
108 x, e1 = self.linear(x)
109
110 if intermediate == True:
111 return x, e1, in_values
112 else:
113 return x, e1
114
115 def get_embedding_dim(self):
116 return 50

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected