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

Method __init__

models/shufflenet.py:53–68  ·  view source on GitHub ↗
(self, cfg, channels=3, num_classes=10, dropout=False)

Source from the content-addressed store, hash-verified

51
52class ShuffleNet(nn.Module):
53 def __init__(self, cfg, channels=3, num_classes=10, dropout=False):
54 super(ShuffleNet, self).__init__()
55 # print (cfg, channels, num_classes)
56 out_planes = cfg['out_planes']
57 num_blocks = cfg['num_blocks']
58 groups = cfg['groups']
59
60 self.conv1 = nn.Conv2d(channels, 24, kernel_size=1, bias=False)
61 self.bn1 = nn.BatchNorm2d(24)
62 self.in_planes = 24
63 self.layer1 = self._make_layer(out_planes[0], num_blocks[0], groups)
64 self.layer2 = self._make_layer(out_planes[1], num_blocks[1], groups)
65 self.layer3 = self._make_layer(out_planes[2], num_blocks[2], groups)
66 self.linear = nn.Linear(out_planes[2], num_classes)
67 self.avgpool = nn.AdaptiveAvgPool2d((1, 1))
68 self.dropout = dropout
69
70 def _make_layer(self, out_planes, num_blocks, groups):
71 layers = []

Callers

nothing calls this directly

Calls 2

_make_layerMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected