Skip to content

Commit cff07cb

Browse files
committed
MobileNet tweaks
1 parent 541fabd commit cff07cb

File tree

2 files changed

+3
-335
lines changed

2 files changed

+3
-335
lines changed

src/convnets/mobilenet.jl

Lines changed: 0 additions & 327 deletions
This file was deleted.

src/convnets/mobilenet/mobilenetv1.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
mobilenetv1(width_mult, config;
33
activation = relu,
44
inchannels = 3,
5-
fcsize = 1024,
65
nclasses = 1000)
76
87
Create a MobileNetv1 model ([reference](https://arxiv.org/abs/1704.04861v1)).
@@ -19,14 +18,12 @@ Create a MobileNetv1 model ([reference](https://arxiv.org/abs/1704.04861v1)).
1918
+ `s`: The stride of the convolutional kernel
2019
+ `r`: The number of time this configuration block is repeated
2120
- `activate`: The activation function to use throughout the network
22-
- `inchannels`: The number of input channels.
23-
- `fcsize`: The intermediate fully-connected size between the convolution and final layers
21+
- `inchannels`: The number of input channels. The default value is 3.
2422
- `nclasses`: The number of output classes
2523
"""
2624
function mobilenetv1(width_mult, config;
2725
activation = relu,
2826
inchannels = 3,
29-
fcsize = 1024,
3027
nclasses = 1000)
3128
layers = []
3229
for (dw, outch, stride, nrepeats) in config
@@ -35,8 +32,7 @@ function mobilenetv1(width_mult, config;
3532
layer = dw ?
3633
depthwise_sep_conv_bn((3, 3), inchannels, outch, activation;
3734
stride = stride, pad = 1, bias = false) :
38-
conv_norm((3, 3), inchannels, outch, activation; stride = stride,
39-
pad = 1,
35+
conv_norm((3, 3), inchannels, outch, activation; stride, pad = 1,
4036
bias = false)
4137
append!(layers, layer)
4238
inchannels = outch
@@ -46,8 +42,7 @@ function mobilenetv1(width_mult, config;
4642
return Chain(Chain(layers),
4743
Chain(GlobalMeanPool(),
4844
MLUtils.flatten,
49-
Dense(inchannels, fcsize, activation),
50-
Dense(fcsize, nclasses)))
45+
Dense(inchannels, nclasses)))
5146
end
5247

5348
const mobilenetv1_configs = [

0 commit comments

Comments
 (0)