MCPcopy Create free account
hub / github.com/alibaba/MNN / _mobileNetV1Expr

Method _mobileNetV1Expr

test/expr/ExecutorResetTest.cpp:35–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 return x;
34 }
35 static VARP _mobileNetV1Expr(VARP x) {
36 int inputSize = 224, poolSize; // MobileNet_224, MobileNet_192, MobileNet_160, MobileNet_128
37 {
38 inputSize = 224;
39 poolSize = inputSize / 32;
40 }
41
42 int channels[6]; // MobileNet_100, MobileNet_075, MobileNet_050, MobileNet_025
43 { channels[0] = 32; }
44
45 for (int i = 1; i < 6; ++i) {
46 channels[i] = channels[0] * (1 << i);
47 }
48
49 x->setName("Input");
50 x = _Conv(0.0f, 0.0f, x, {3, channels[0]}, {3, 3}, SAME, {2, 2}, {1, 1}, 1);
51 x = convBlock(x, {channels[0], channels[1]}, 1);
52 x = convBlock(x, {channels[1], channels[2]}, 2);
53 x = convBlock(x, {channels[2], channels[2]}, 1);
54 x = convBlock(x, {channels[2], channels[3]}, 2);
55 x = convBlock(x, {channels[3], channels[3]}, 1);
56 x = convBlock(x, {channels[3], channels[4]}, 2);
57 x = convBlock(x, {channels[4], channels[4]}, 1);
58 x = convBlocTemp(x, {channels[4], channels[4]}, 1);
59 x = convBlock(x, {channels[4], channels[4]}, 1);
60 x = convBlock(x, {channels[4], channels[4]}, 1);
61 x = convBlock(x, {channels[4], channels[4]}, 1);
62 x = convBlock(x, {channels[4], channels[5]}, 2);
63 x = convBlock(x, {channels[5], channels[5]}, 1);
64 x = _AvePool(x, {poolSize, poolSize}, {1, 1}, VALID);
65 x = _Conv(0.0f, 0.0f, x, {channels[5], 1001}, {1, 1}, VALID, {1, 1}, {1, 1}, 1); // reshape FC with Conv1x1
66 x = _Softmax(x, -1);
67 x = _Convert(x, NCHW);
68 x->setName("Prob");
69 return x;
70 }
71 bool _runmbv1() {
72 auto x = _Input({1, 3, 224, 224}, NC4HW4);
73 auto y = _mobileNetV1Expr(x);

Callers

nothing calls this directly

Calls 7

convBlocTempFunction · 0.85
_AvePoolFunction · 0.85
_SoftmaxFunction · 0.85
_ConvertFunction · 0.85
convBlockFunction · 0.70
_ConvFunction · 0.50
setNameMethod · 0.45

Tested by

no test coverage detected