MCPcopy Create free account
hub / github.com/TPCD/DCCL / forward

Method forward

model/vision_transformer.py:453–467  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

451 nn.init.constant_(m.bias, 0)
452
453 def forward(self, x):
454 probability = []
455 attribute_embedding = []
456 for individual_head in self.classifier_list:
457 projected = individual_head[0](x)
458 _attribute_embedding = individual_head[1](projected)
459 attribute_embedding.append(_attribute_embedding.detach().clone())
460 logit = individual_head[2](_attribute_embedding)
461 probability.append(self._log_softmax(logit))
462 attribute_embedding = torch.cat(attribute_embedding, dim=1)
463
464 if self.training == True:
465 return probability
466 else:
467 return attribute_embedding
468
469
470class Attribute_Classifier3(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected