Skip to content

Commit 1eb8a51

Browse files
authored
Merge pull request #103 from theabhirath/mlpmixer
Implementation of MLPMixer
2 parents 4dbdfd5 + 44de174 commit 1eb8a51

File tree

18 files changed

+379
-228
lines changed

18 files changed

+379
-228
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
88
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
99
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
1010
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
11+
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
12+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1113

1214
[compat]
1315
BSON = "0.3.2"
1416
Flux = "0.12"
1517
Functors = "0.2"
16-
julia = "1.4"
1718
NNlib = "0.7.34"
19+
julia = "1.4"
1820

1921
[extras]
2022
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
21-
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
2223

2324
[publish]
2425
title = "Metalhead.jl"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
| ResNeXt-152 | [`ResNeXt`](https://fluxml.ai/Metalhead.jl/dev/docstrings/Metalhead.ResNeXt.html) | N |
4242
| [MobileNetv2](https://arxiv.org/abs/1801.04381) | [`MobileNetv2`](https://fluxml.ai/Metalhead.jl/dev/docstrings/Metalhead.MobileNetv2.html) | N |
4343
| [MobileNetv3](https://arxiv.org/abs/1905.02244) | [`MobileNetv3`](https://fluxml.ai/Metalhead.jl/dev/docstrings/Metalhead.MobileNetv3.html) | N |
44-
44+
| [MLPMixer](https://arxiv.org/pdf/2105.01601) | [`MLPMixer`](https://fluxml.ai/Metalhead.jl/dev/docstrings/Metalhead.MLPMixer.html) | N |
4545

4646
## Getting Started
4747

src/Metalhead.jl

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,39 @@ using Flux: outputsize, Zygote
55
using Functors
66
using BSON
77
using Artifacts, LazyArtifacts
8+
using Statistics
89

910
import Functors
1011

11-
# Models
1212
include("utilities.jl")
13-
include("alexnet.jl")
14-
include("vgg.jl")
15-
include("resnet.jl")
16-
include("googlenet.jl")
17-
include("inception.jl")
18-
include("squeezenet.jl")
19-
include("densenet.jl")
20-
include("resnext.jl")
21-
include("mobilenet.jl")
13+
include("layers.jl")
14+
15+
# CNN models
16+
include("convnets/alexnet.jl")
17+
include("convnets/vgg.jl")
18+
include("convnets/inception.jl")
19+
include("convnets/googlenet.jl")
20+
include("convnets/resnet.jl")
21+
include("convnets/resnext.jl")
22+
include("convnets/densenet.jl")
23+
include("convnets/squeezenet.jl")
24+
include("convnets/mobilenet.jl")
25+
26+
# Other models
27+
include("other/mlpmixer.jl")
2228

2329
export AlexNet,
2430
VGG, VGG11, VGG13, VGG16, VGG19,
2531
ResNet, ResNet18, ResNet34, ResNet50, ResNet101, ResNet152,
2632
GoogLeNet, Inception3, SqueezeNet,
2733
DenseNet, DenseNet121, DenseNet161, DenseNet169, DenseNet201,
2834
ResNeXt,
29-
MobileNetv2, MobileNetv3
35+
MobileNetv2, MobileNetv3,
36+
MLPMixer
3037

3138
# use Flux._big_show to pretty print large models
3239
for T in (:AlexNet, :VGG, :ResNet, :GoogLeNet, :Inception3, :SqueezeNet, :DenseNet, :ResNeXt,
33-
:MobileNetv2, :MobileNetv3)
40+
:MobileNetv2, :MobileNetv3, :MLPMixer)
3441
@eval Base.show(io::IO, ::MIME"text/plain", model::$T) = _maybe_big_show(io, model)
3542
end
3643

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)