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

Function _mobileNetV1Expr

test/expr/MemoryIncrease.cpp:30–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30VARP _mobileNetV1Expr() {
31 int inputSize = 224, poolSize; // MobileNet_224, MobileNet_192, MobileNet_160, MobileNet_128
32 {
33 inputSize = 224;
34 poolSize = inputSize / 32;
35 }
36
37 int channels[6]; // MobileNet_100, MobileNet_075, MobileNet_050, MobileNet_025
38 { channels[0] = 32; }
39
40 for (int i = 1; i < 6; ++i) {
41 channels[i] = channels[0] * (1 << i);
42 }
43
44 auto x = _Input({1, 3, inputSize, inputSize}, NC4HW4);
45 x = _Conv(0.0f, 0.0f, x, {3, channels[0]}, {3, 3}, SAME, {2, 2}, {1, 1}, 1);
46 x = convBlock(x, {channels[0], channels[1]}, 1);
47 x = convBlock(x, {channels[1], channels[2]}, 2);
48 x = convBlock(x, {channels[2], channels[2]}, 1);
49 x = convBlock(x, {channels[2], channels[3]}, 2);
50 x = convBlock(x, {channels[3], channels[3]}, 1);
51 x = convBlock(x, {channels[3], channels[4]}, 2);
52 x = convBlock(x, {channels[4], channels[4]}, 1);
53 x = convBlock(x, {channels[4], channels[4]}, 1);
54 x = convBlock(x, {channels[4], channels[4]}, 1);
55 x = convBlock(x, {channels[4], channels[4]}, 1);
56 x = convBlock(x, {channels[4], channels[4]}, 1);
57 x = convBlock(x, {channels[4], channels[5]}, 2);
58 x = convBlock(x, {channels[5], channels[5]}, 1);
59 x = _AvePool(x, {poolSize, poolSize}, {1, 1}, VALID);
60 x = _Conv(0.0f, 0.0f, x, {channels[5], 1001}, {1, 1}, VALID, {1, 1}, {1, 1}, 1); // reshape FC with Conv1x1
61 x = _Softmax(x, -1);
62 return x;
63}
64class MemoryIncreaseMobileNetV1Test : public MNNTestCase {
65public:
66 virtual bool run(int precision) {

Callers 1

runMethod · 0.70

Calls 5

_InputFunction · 0.85
_AvePoolFunction · 0.85
_SoftmaxFunction · 0.85
convBlockFunction · 0.70
_ConvFunction · 0.50

Tested by

no test coverage detected