| 95 | |
| 96 | # net |
| 97 | class 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 |
nothing calls this directly
no outgoing calls
no test coverage detected