(self, x)
| 723 | nn.init.constant_(m.bias, 0) |
| 724 | |
| 725 | def forward(self, x): |
| 726 | probability = [] |
| 727 | if self.shared_projected_layer is None: |
| 728 | attribute_embedding = [] |
| 729 | for classifier in self.classifier_list: |
| 730 | projected = classifier[0](x) |
| 731 | bn_projected = classifier[1](projected) |
| 732 | attribute_embedding.append(bn_projected.detach().clone()) |
| 733 | activate = classifier[2](bn_projected) |
| 734 | logit = classifier[3](activate) |
| 735 | # attribute_embedding.append(logit.detach().clone()) |
| 736 | probability.append(self._log_softmax(logit)) |
| 737 | attribute_embedding = torch.cat(attribute_embedding, dim=1) |
| 738 | else: |
| 739 | attribute_embedding = self.shared_projected_layer(x) |
| 740 | for classifier in self.classifier_list: |
| 741 | logit = classifier(attribute_embedding) |
| 742 | probability.append(self._log_softmax(logit)) |
| 743 | if self.training == True: |
| 744 | return probability |
| 745 | else: |
| 746 | return attribute_embedding |
| 747 | |
| 748 | |
| 749 | class Attribute_Classifier6ind(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected