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

Method __init__

examples/cnn_ms/autograd/xceptionnet.py:128–235  ·  view source on GitHub ↗

Constructor Args: num_classes: number of classes

(self, num_classes=1000)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

BlockClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected