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

Function CreateNet

examples/cpp/cifar10/vgg-parallel.cc:165–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165FeedForwardNet CreateNet() {
166 FeedForwardNet net;
167 Shape s{3, 32, 32};
168 ConvBNReLU(net, "conv1_1", 64, &s);
169 net.Add(GenDropoutConf("drop1", 0.3));
170 ConvBNReLU(net, "conv1_2", 64);
171 net.Add(GenPoolingConf("pool1", true, 2, 2, 0));
172 ConvBNReLU(net, "conv2_1", 128);
173 net.Add(GenDropoutConf("drop2", 0.4));
174 ConvBNReLU(net, "conv2_2", 128);
175 net.Add(GenPoolingConf("pool2", true, 2, 2, 0));
176 ConvBNReLU(net, "conv3_1", 256);
177 net.Add(GenDropoutConf("drop3_1", 0.4));
178 ConvBNReLU(net, "conv3_2", 256);
179 net.Add(GenDropoutConf("drop3_2", 0.4));
180 ConvBNReLU(net, "conv3_3", 256);
181 net.Add(GenPoolingConf("pool3", true, 2, 2, 0));
182 ConvBNReLU(net, "conv4_1", 512);
183 net.Add(GenDropoutConf("drop4_1", 0.4));
184 ConvBNReLU(net, "conv4_2", 512);
185 net.Add(GenDropoutConf("drop4_2", 0.4));
186 ConvBNReLU(net, "conv4_3", 512);
187 net.Add(GenPoolingConf("pool4", true, 2, 2, 0));
188 ConvBNReLU(net, "conv5_1", 512);
189 net.Add(GenDropoutConf("drop5_1", 0.4));
190 ConvBNReLU(net, "conv5_2", 512);
191 net.Add(GenDropoutConf("drop5_2", 0.4));
192 ConvBNReLU(net, "conv5_3", 512);
193 net.Add(GenPoolingConf("pool5", true, 2, 2, 0));
194 net.Add(GenFlattenConf("flat"));
195 net.Add(GenDropoutConf("flat_drop", 0.5));
196 net.Add(GenDenseConf("ip1", 512, 0.02));
197 net.Add(GenBatchNormConf("ip1_bn"));
198 net.Add(GenReLUConf("ip1_relu"));
199 net.Add(GenDropoutConf("ip1_drop", 0.5));
200 net.Add(GenDenseConf("ip2", 10, 0.02));
201
202 return net;
203}
204
205void Train(float lr, int num_epoch, string data_dir) {
206 Cifar10 data(data_dir);

Callers 1

TrainFunction · 0.70

Calls 8

ConvBNReLUFunction · 0.85
GenBatchNormConfFunction · 0.85
AddMethod · 0.80
GenDropoutConfFunction · 0.70
GenPoolingConfFunction · 0.70
GenFlattenConfFunction · 0.70
GenDenseConfFunction · 0.70
GenReLUConfFunction · 0.70

Tested by

no test coverage detected