Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to latest Lux and LuxCore releases #57

Merged
merged 21 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Pull Julia cache
uses: julia-actions/cache@v2
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
run: julia --project=docs -e 'using Pkg; Pkg.develop(Pkg.PackageSpec(path=".")); Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
- name: Build the tutorials
run: julia --project=docs docs/tutorials.jl
- name: Build and deploy docs
Expand Down
94 changes: 27 additions & 67 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,111 +1,71 @@
[alexnet]
git-tree-sha1 = "8904a6756649aa4cd264328430b829dafde95645"
git-tree-sha1 = "f1739363d54a358cae904133699a93eca7b7a028"
lazy = true

[[alexnet.download]]
sha256 = "e20107404aba1c2c0ed3fad4314033a2fa600cdc0c55d03bc1bfe4f8e5031105"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/alexnet.tar.gz"

# [resnet101]
# git-tree-sha1 = "6c9143d40950726405b88db0cc021fa1dcbc0896"
# lazy = true

# [[resnet101.download]]
# sha256 = "3840f05b3d996b2b3ea1e8fb6617775fd60ad6b8769402200fdc9c8b8dca246f"
# url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/resnet101.tar.gz"

# [resnet152]
# git-tree-sha1 = "892915c44de37537aad97da3de8a4458dfa36297"
# lazy = true

# [[resnet152.download]]
# sha256 = "6033a1ecc46d7f4ed1139067c5f9f5ea0d247656e9abbbe755c4702ec5a636d6"
# url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/resnet152.tar.gz"

# [resnet18]
# git-tree-sha1 = "1d4a46fee1bb87eeef0ce2c85f63cfe0ff47d4de"
# lazy = true

# [[resnet18.download]]
# sha256 = "f4041ea1d1ec9bba86c7a5a519daaa49bb096a55fcd4ebf74f0743c8bdcb1c35"
# url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/resnet18.tar.gz"

# [resnet34]
# git-tree-sha1 = "306a8055ae9207ae2a316e31b376254557e481c9"
# lazy = true

# [[resnet34.download]]
# sha256 = "d62e40ee9213ea9611e3fcedc958df4011da1fa108fb1537bac91e6b7778a3c8"
# url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/resnet34.tar.gz"

# [resnet50]
# git-tree-sha1 = "8c5866edb29b53f581a9ed7148efa1dbccde6133"
# lazy = true

# [[resnet50.download]]
# sha256 = "275365d76e592c6ea35574853a75ee068767641664e7817aedf394fcd7fea25a"
# url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/resnet50.tar.gz"
sha256 = "feb3e1600179ba00b72a68759c7f3b12f400f6d59b28ac72b48614cbafa187d8"
url = "https://huggingface.co/LuxDL/alexnet/resolve/2c48051ecb131d38f2209470cdda70a343289db1/alexnet.tar.gz"

[vgg11]
git-tree-sha1 = "ea7e8ef9399a0fe0aad2331781af5d6435950d36"
git-tree-sha1 = "2468801ab9bc7343c02a141e145e95209236b218"
lazy = true

[[vgg11.download]]
sha256 = "a88b78c4e939138270068933f6278fa6392ce699991385000b1b9bb0ff53fa3e"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg11.tar.gz"
sha256 = "509567b428c02f7e9fa69ad7b6e0f62a1347ce6ec7fbad4e4cb4fddbf4f66b60"
url = "https://huggingface.co/LuxDL/vgg/resolve/ac7292d920627cdb66caee17420bfee5dbfe0f61/vgg11.tar.gz"

[vgg11_bn]
git-tree-sha1 = "6bb8128b150ac7ca30c32e34295d8d7403471942"
git-tree-sha1 = "e444f279f7b6641da80f4910362d0ccb37a5fe96"
lazy = true

[[vgg11_bn.download]]
sha256 = "159392d11cb5ced5bfe66dc9da7bd12fbbf92687bbea9e9bb96bf0c6b58c9ef2"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg11_bn.tar.gz"
sha256 = "8ed6002ccad7e204276d638e8bc288cce85f6b26f0a6d7cb5a85d714750a0cc7"
url = "https://huggingface.co/LuxDL/vgg/resolve/0ecfa4aea43abc4bbf27fd7f185ffda3fdc5d31a/vgg11_bn.tar.gz"

[vgg13]
git-tree-sha1 = "260246834e15048ec128fadc6d1a5dd050dd0928"
git-tree-sha1 = "d9b0cc88a71a8eabe3375e9bb92b601cb0c984a5"
lazy = true

[[vgg13.download]]
sha256 = "757c555f47e2dd4898e89fcb6fb94f1a7a9977e4cdbdba5502eacd1d3496cf3b"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg13.tar.gz"
sha256 = "4c554fb0d7ed976019c0d03ffe9ec6ed0cc88d8fa94a3405c65b55e138c5a7b7"
url = "https://huggingface.co/LuxDL/vgg/resolve/f4a690e83af5a8f9e907e33de0b2d53b8a6ad1cc/vgg13.tar.gz"

[vgg13_bn]
git-tree-sha1 = "623d2ae96cbf935ae09067fb7e85ca6894b79447"
git-tree-sha1 = "12ac8f1c9fadfcd4fb80db270ffa17ec96375fb7"
lazy = true

[[vgg13_bn.download]]
sha256 = "3ccfb481b79bf56e6b70fefbc727127f5eb6de6478b1c57be669e5e5bb007377"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg13_bn.tar.gz"
sha256 = "e6f69a7580a9af6eedbbb11c1c590ad6da4e57872dfdb2ac38f2e085d50b429b"
url = "https://huggingface.co/LuxDL/vgg/resolve/5f6acdbc972e0455428c4618c41ebedcd7d5b14b/vgg13_bn.tar.gz"

[vgg16]
git-tree-sha1 = "0e4d8a869e2688c765a3126c8a8c59e4a58fe97d"
git-tree-sha1 = "8b85924419036f584e32aac9500b1d198a3b748a"
lazy = true

[[vgg16.download]]
sha256 = "79463750e1fd2424928b21a8d5d0cb2328c46e5cf39252600e0d132570bfd931"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg16.tar.gz"
sha256 = "9e2905a02c4f2425e199b5d7b47aad9c6d2029850d2f2fd4d9c1a9d26dafb163"
url = "https://huggingface.co/LuxDL/vgg/resolve/d05baefb64db70c66ccfe6daa6e2a3b7ce8b3021/vgg16.tar.gz"

[vgg16_bn]
git-tree-sha1 = "b93f35dddcaec69444e0cfb709a19be4fb6be53f"
git-tree-sha1 = "46d8299cc071102ceaf9e7d84699a7029dc0293a"
lazy = true

[[vgg16_bn.download]]
sha256 = "98f3e88c12fd07faa20505c864bfe2afc17e714ac5ddb4b05018fab25d9b3373"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg16_bn.tar.gz"
sha256 = "b0fb3382434fd4f025f2e5517fc29b787aca093300d1a683d4dc10d380d102ed"
url = "https://huggingface.co/LuxDL/vgg/resolve/79b657b252c9b9a2f0fecb67c10ba4ec6c4fed0b/vgg16_bn.tar.gz"

[vgg19]
git-tree-sha1 = "8c0f1bdb7e540f1529a4038a0c73971debb1634b"
git-tree-sha1 = "4dfc386f5da165daf80429b15a9a6bf7c2bf1b3b"
lazy = true

[[vgg19.download]]
sha256 = "2cedf1574207abe1989619aab292c51964dc27226b8852f0ce8a5acbc66ded31"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg19.tar.gz"
sha256 = "662c7a63b07fdf52bb548a2019c31dd19d43e8675beb8fecf9ff3901ba36ef6e"
url = "https://huggingface.co/LuxDL/vgg/resolve/0268c4327e5ab4ae7172755bb767bf80dd792b0c/vgg19.tar.gz"

[vgg19_bn]
git-tree-sha1 = "fb3ec225e8a0b2eb838be682c6facceaa5b8aad3"
git-tree-sha1 = "c0db4c840ae575da62ed28b3fcb29e3ca4da570a"
lazy = true

[[vgg19_bn.download]]
sha256 = "7a8d3d43ea092db4f53e721015078fcba4980dd5534a743f2b388165f8af185d"
url = "https://github.com/LuxDL/Lux.jl/releases/download/weights/vgg19_bn.tar.gz"
sha256 = "43a0005b4f4ad261773e5a9dd2241165c211be476d6bce8493fd470bfe16ef5f"
url = "https://huggingface.co/LuxDL/vgg/resolve/9b3f3be58a84e52b40f5489c481d954d0cf4f2b4/vgg19_bn.tar.gz"
16 changes: 10 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Boltz"
uuid = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "0.4.2"
version = "1.0.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -11,6 +11,7 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
Expand All @@ -20,6 +21,7 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
WeightInitializers = "d49dbf32-c5c2-4618-8acc-27bb2598ef2d"

Expand Down Expand Up @@ -51,18 +53,20 @@ ConcreteStructs = "0.2.3"
DataInterpolations = "< 5.3"
DynamicExpressions = "0.16, 0.17, 0.18, 0.19"
ForwardDiff = "0.10.36"
Functors = "0.4.12"
GPUArraysCore = "0.1.6"
JLD2 = "0.4.48"
JLD2 = "0.5"
LazyArtifacts = "1.10"
Lux = "0.5.66"
LuxCore = "0.1.24"
MLDataDevices = "1.0.1"
Lux = "1"
LuxCore = "1"
MLDataDevices = "1.1"
Markdown = "1.10"
Metalhead = "0.9"
Metalhead = "0.9.4"
NNlib = "0.9.21"
Random = "1.10"
Reexport = "1.2.2"
ReverseDiff = "1.15"
Static = "1.1.1"
Statistics = "1.10"
Tracker = "0.2.34"
WeightInitializers = "1"
Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Boltz = "0.4"
Boltz = "1"
Documenter = "1"
DocumenterCitations = "1"
DocumenterVitepress = "0.1"
DynamicExpressions = "0.16, 0.17, 0.18, 0.19"
Lux = "0.5.65"
Lux = "1"
Random = "1.10"
Zygote = "0.6.70"
20 changes: 20 additions & 0 deletions docs/ref.bib
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,23 @@ @inproceedings{howard2019searching
pages = {1314--1324},
year = {2019}
}

@misc{iandola2016squeezenetalexnetlevelaccuracy50x,
title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size},
author = {Forrest N. Iandola and Song Han and Matthew W. Moskewicz and Khalid Ashraf and William J. Dally and Kurt Keutzer},
year = {2016},
eprint = {1602.07360},
archiveprefix = {arXiv},
primaryclass = {cs.CV},
url = {https://arxiv.org/abs/1602.07360}
}

@misc{zagoruyko2017wideresidualnetworks,
title = {Wide Residual Networks},
author = {Sergey Zagoruyko and Nikos Komodakis},
year = {2017},
eprint = {1605.07146},
archiveprefix = {arXiv},
primaryclass = {cs.CV},
url = {https://arxiv.org/abs/1605.07146}
}
44 changes: 31 additions & 13 deletions docs/src/api/vision.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Native Lux Models

```@docs
Vision.AlexNet
Vision.VGG
Vision.VisionTransformer
```
Expand All @@ -14,13 +15,14 @@ Vision.VisionTransformer
You need to load `Metalhead` before using these models.

```@docs
Vision.AlexNet
Vision.ConvMixer
Vision.DenseNet
Vision.GoogLeNet
Vision.MobileNet
Vision.ResNet
Vision.ResNeXt
Vision.SqueezeNet
Vision.WideResNet
```

## Pretrained Models
Expand All @@ -33,18 +35,34 @@ Vision.ResNeXt

Pass `pretrained=true` to the model constructor to load the pretrained weights.


| MODEL | TOP 1 ACCURACY (%) | TOP 5 ACCURACY (%) |
| :------------------------ | :----------------: | :----------------: |
| `AlexNet()` | 54.48 | 77.72 |
| `VGG(11)` | 67.35 | 87.91 |
| `VGG(13)` | 68.40 | 88.48 |
| `VGG(16)` | 70.24 | 89.80 |
| `VGG(19)` | 71.09 | 90.27 |
| `VGG(11; batchnorm=true)` | 69.09 | 88.94 |
| `VGG(13; batchnorm=true)` | 69.66 | 89.49 |
| `VGG(16; batchnorm=true)` | 72.11 | 91.02 |
| `VGG(19; batchnorm=true)` | 72.95 | 91.32 |
| MODEL | TOP 1 ACCURACY (%) | TOP 5 ACCURACY (%) |
| :------------------------------------------- | :----------------: | :----------------: |
| `AlexNet()` | 54.48 | 77.72 |
| `VGG(11)` | 67.35 | 87.91 |
| `VGG(13)` | 68.40 | 88.48 |
| `VGG(16)` | 70.24 | 89.80 |
| `VGG(19)` | 71.09 | 90.27 |
| `VGG(11; batchnorm=true)` | 69.09 | 88.94 |
| `VGG(13; batchnorm=true)` | 69.66 | 89.49 |
| `VGG(16; batchnorm=true)` | 72.11 | 91.02 |
| `VGG(19; batchnorm=true)` | 72.95 | 91.32 |
| `ResNet(18)` | - | - |
| `ResNet(34)` | - | - |
| `ResNet(50)` | - | - |
| `ResNet(101)` | - | - |
| `ResNet(152)` | - | - |
| `ResNeXt(50; cardinality=32, base_width=4)` | - | - |
| `ResNeXt(101; cardinality=32, base_width=8)` | - | - |
| `ResNeXt(101; cardinality=64, base_width=4)` | - | - |
| `SqueezeNet()` | - | - |
| `WideResNet(50)` | - | - |
| `WideResNet(101)` | - | - |

!!! note "Pretrained Models from Metalhead"

For Models imported from Metalhead, the pretrained weights can be loaded if they are
available in Metalhead. Refer to the [Metalhead.jl docs](https://fluxml.ai/Metalhead.jl/stable/#Image-Classification)
for a list of available pretrained models.

### Preprocessing

Expand Down
6 changes: 3 additions & 3 deletions examples/GettingStarted/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Metalhead = "dbeba491-748d-5e0e-a39e-b530a07fa0cc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Boltz = "0.4"
Boltz = "1"
InteractiveUtils = "<0.0.1, 1"
JLD2 = "0.4.52"
JLD2 = "0.4.52, 0.5"
Literate = "2.19"
Lux = "0.5.65"
Lux = "1"
Metalhead = "0.9.3"
Random = "1.10"
14 changes: 3 additions & 11 deletions examples/GettingStarted/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ model = Layers.MLP(784, (256, 10), relu)

# ## How about VGG?
#
# !!! warning "Returned Values"
#
# The returned value from `Vision` module functions are a 3 tuple of (model, ps, st).
# The `ps` and `st` are the parameters and states of the model respectively.
#
# Let's take a look at the `Vision` module. We can construct a VGG model with the
# following code:

model, _, _ = Vision.VGG(13)
model
Vision.VGG(13)

# We can also load pretrained ImageNet weights using

Expand All @@ -48,14 +42,12 @@ model

using JLD2

model, _, _ = Vision.VGG(13; pretrained=true)
model
Vision.VGG(13; pretrained=true)

# ## Loading Models from Metalhead (Flux.jl)

# We can load models from Metalhead (Flux.jl), just remember to load `Metalhead` before.

using Metalhead

model, _, _ = Vision.ResNet(18)
model
Vision.ResNet(18)
10 changes: 5 additions & 5 deletions examples/SymbolicOptimalControl/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqVerner = "79d7bb75-1356-48c1-b8c0-6832512096c2"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Expand All @@ -20,19 +20,19 @@ SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"

[compat]
Boltz = "0.4"
Boltz = "1"
CairoMakie = "0.12"
ComponentArrays = "0.15.11"
DynamicExpressions = "0.16, 0.17, 0.18, 0.19"
Latexify = "0.16.2"
Literate = "2"
Lux = "0.5"
Lux = "1"
MLJ = "0.20.3"
Optimization = "3.24.3"
OptimizationOptimJL = "0.2.3, 0.3"
OptimizationOptimisers = "0.2.1"
OrdinaryDiffEq = "6.74.1"
OrdinaryDiffEqVerner = "1"
SciMLSensitivity = "7.57"
Statistics = "1.11"
Statistics = "1.10"
SymbolicRegression = "0.24.1"
SymbolicUtils = "1.5.1, 2, 3"
Loading
Loading