@@ -52,41 +52,40 @@ function mobilenetv3(width_mult, configs; inchannels = 3, max_width = 1024, ncla
52
52
Chain (AdaptiveMeanPool ((1 , 1 )), MLUtils. flatten, classifier))
53
53
end
54
54
55
- # Configurations for small and large mode for MobileNetv3
56
- MOBILENETV3_CONFIGS = Dict (:small => [
57
- # k, t, c, SE, a, s
58
- (3 , 1 , 16 , 4 , relu, 2 ),
59
- (3 , 4.5 , 24 , nothing , relu, 2 ),
60
- (3 , 3.67 , 24 , nothing , relu, 1 ),
61
- (5 , 4 , 40 , 4 , hardswish, 2 ),
62
- (5 , 6 , 40 , 4 , hardswish, 1 ),
63
- (5 , 6 , 40 , 4 , hardswish, 1 ),
64
- (5 , 3 , 48 , 4 , hardswish, 1 ),
65
- (5 , 3 , 48 , 4 , hardswish, 1 ),
66
- (5 , 6 , 96 , 4 , hardswish, 2 ),
67
- (5 , 6 , 96 , 4 , hardswish, 1 ),
68
- (5 , 6 , 96 , 4 , hardswish, 1 ),
69
- ],
70
- :large => [
71
- # k, t, c, SE, a, s
72
- (3 , 1 , 16 , nothing , relu, 1 ),
73
- (3 , 4 , 24 , nothing , relu, 2 ),
74
- (3 , 3 , 24 , nothing , relu, 1 ),
75
- (5 , 3 , 40 , 4 , relu, 2 ),
76
- (5 , 3 , 40 , 4 , relu, 1 ),
77
- (5 , 3 , 40 , 4 , relu, 1 ),
78
- (3 , 6 , 80 , nothing , hardswish, 2 ),
79
- (3 , 2.5 , 80 , nothing , hardswish, 1 ),
80
- (3 , 2.3 , 80 , nothing , hardswish, 1 ),
81
- (3 , 2.3 , 80 , nothing , hardswish, 1 ),
82
- (3 , 6 , 112 , 4 , hardswish, 1 ),
83
- (3 , 6 , 112 , 4 , hardswish, 1 ),
84
- (5 , 6 , 160 , 4 , hardswish, 2 ),
85
- (5 , 6 , 160 , 4 , hardswish, 1 ),
86
- (5 , 6 , 160 , 4 , hardswish, 1 ),
87
- ])
55
+ # Layer configurations for small and large models for MobileNetv3
56
+ const MOBILENETV3_CONFIGS = Dict (:small => [
57
+ # k, t, c, SE, a, s
58
+ (3 , 1 , 16 , 4 , relu, 2 ),
59
+ (3 , 4.5 , 24 , nothing , relu, 2 ),
60
+ (3 , 3.67 , 24 , nothing , relu, 1 ),
61
+ (5 , 4 , 40 , 4 , hardswish, 2 ),
62
+ (5 , 6 , 40 , 4 , hardswish, 1 ),
63
+ (5 , 6 , 40 , 4 , hardswish, 1 ),
64
+ (5 , 3 , 48 , 4 , hardswish, 1 ),
65
+ (5 , 3 , 48 , 4 , hardswish, 1 ),
66
+ (5 , 6 , 96 , 4 , hardswish, 2 ),
67
+ (5 , 6 , 96 , 4 , hardswish, 1 ),
68
+ (5 , 6 , 96 , 4 , hardswish, 1 ),
69
+ ],
70
+ :large => [
71
+ # k, t, c, SE, a, s
72
+ (3 , 1 , 16 , nothing , relu, 1 ),
73
+ (3 , 4 , 24 , nothing , relu, 2 ),
74
+ (3 , 3 , 24 , nothing , relu, 1 ),
75
+ (5 , 3 , 40 , 4 , relu, 2 ),
76
+ (5 , 3 , 40 , 4 , relu, 1 ),
77
+ (5 , 3 , 40 , 4 , relu, 1 ),
78
+ (3 , 6 , 80 , nothing , hardswish, 2 ),
79
+ (3 , 2.5 , 80 , nothing , hardswish, 1 ),
80
+ (3 , 2.3 , 80 , nothing , hardswish, 1 ),
81
+ (3 , 2.3 , 80 , nothing , hardswish, 1 ),
82
+ (3 , 6 , 112 , 4 , hardswish, 1 ),
83
+ (3 , 6 , 112 , 4 , hardswish, 1 ),
84
+ (5 , 6 , 160 , 4 , hardswish, 2 ),
85
+ (5 , 6 , 160 , 4 , hardswish, 1 ),
86
+ (5 , 6 , 160 , 4 , hardswish, 1 ),
87
+ ])
88
88
89
- # Model definition for MobileNetv3
90
89
struct MobileNetv3
91
90
layers:: Any
92
91
end
0 commit comments