model package¶
Submodules¶
model.BK module¶
model.make_mode_diffl module¶
model.make_model module¶
- class model.make_model.Backbone(num_classes, cfg)¶
Bases:
torch.nn.modules.module.Module
default use learning backbone network
set the configurations in /config
calling forward_gcn_cluster for forward function
other modfication
- self.attention1 = GATConv(512,hidden,dropout=self.dropout,alpha=0.2,batch_size=8)
self.attention2 = GATConv(512, hidden, dropout=self.dropout, alpha=0.2,batch_size=8)
self.graphconv=GATConv(self.nheads*hidden,512,dropout=self.dropout,alpha=0.2,concat=False,batch_size=8)
- forward(inputs, label=None, mode='train')¶
label is unused if self.cos_layer == 'no' Args:
inputs: input image batched label: labels batched mode: train or test
- Returns:
classification probabilities batched.
- forward_backbone_coattention(inputs, label=None)¶
cross attention fine-grained recognition, high-performance:88+ Args:
inputs: label:
Returns:
- forward_gcn(inputs, label=None)¶
forward local connected GCNs
- Args:
inputs: label:
Returns:
- forward_gcn_cluster(inputs, label=None)¶
- forward_pure(inputs, label=None)¶
- forward_test(inputs, label=None)¶
- load_param(trained_path)¶
- reinit_param()¶
- model.make_model.make_model(cfg, num_class)¶
- model.make_model.weights_init_classifier(m)¶
- model.make_model.weights_init_kaiming(m)¶