MCPcopy Create free account
hub / github.com/apache/singa / __init__

Method __init__

examples/cnn/model/xceptionnet.py:119–230  ·  view source on GitHub ↗

Constructor Args: num_classes: number of classes

(self, num_classes=10, num_channels=3)

Source from the content-addressed store, hash-verified

117 """
118
119 def __init__(self, num_classes=10, num_channels=3):
120 """ Constructor
121 Args:
122 num_classes: number of classes
123 """
124 super(Xception, self).__init__()
125 self.num_classes = num_classes
126 self.input_size = 299
127 self.dimension = 4
128
129 self.conv1 = layer.Conv2d(num_channels, 32, 3, 2, 0, bias=False)
130 self.bn1 = layer.BatchNorm2d(32)
131 self.relu1 = layer.ReLU()
132
133 self.conv2 = layer.Conv2d(32, 64, 3, 1, 1, bias=False)
134 self.bn2 = layer.BatchNorm2d(64)
135 self.relu2 = layer.ReLU()
136 # do relu here
137
138 self.block1 = Block(64,
139 128,
140 2,
141 2,
142 padding=0,
143 start_with_relu=False,
144 grow_first=True)
145 self.block2 = Block(128,
146 256,
147 2,
148 2,
149 padding=0,
150 start_with_relu=True,
151 grow_first=True)
152 self.block3 = Block(256,
153 728,
154 2,
155 2,
156 padding=0,
157 start_with_relu=True,
158 grow_first=True)
159
160 self.block4 = Block(728,
161 728,
162 3,
163 1,
164 start_with_relu=True,
165 grow_first=True)
166 self.block5 = Block(728,
167 728,
168 3,
169 1,
170 start_with_relu=True,
171 grow_first=True)
172 self.block6 = Block(728,
173 728,
174 3,
175 1,
176 start_with_relu=True,

Callers

nothing calls this directly

Calls 2

BlockClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected