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

refactor: general cleanup of internals and documentation #47

Merged
merged 14 commits into from
Aug 24, 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 .JuliaFormatter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ indent = 4
format_docstrings = true
separate_kwargs_with_semicolon = true
always_for_in = true
join_lines_based_on_source = false
join_lines_based_on_source = true
annotate_untyped_fields_with_any = false
26 changes: 26 additions & 0 deletions .github/workflows/DocCleanUp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "avik-pal"
git config user.email "avikpal@mit.edu"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
51 changes: 51 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Documenter

on:
# Runs on pushes targeting the `master` branch. Change this to `main` if you're
# using the `main` branch as the default branch.
push:
branches:
- main
tags: ['*']
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: write
contents: write
pages: write
id-token: write
statuses: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Pull Julia cache
uses: julia-actions/cache@v1
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
- name: Build and deploy docs
uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: "100" # for Plots.jl plots (if you have them)
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ docs/site

scripts
test_ext

package-lock.json
node_modules
14 changes: 8 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name = "Boltz"
uuid = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
authors = ["Avik Pal <avikpal@mit.edu> and contributors"]
version = "0.3.11"
version = "0.3.12"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
Expand Down Expand Up @@ -36,23 +37,24 @@ BoltzZygoteExt = "Zygote"
[compat]
ADTypes = "1.5"
ArgCheck = "2.3"
Artifacts = "1.10, 1"
Artifacts = "1.10"
ChainRulesCore = "1.24"
Compat = "4.15"
ConcreteStructs = "0.2.3"
DataInterpolations = "< 5.3"
ForwardDiff = "0.10.36"
GPUArraysCore = "0.1.6"
JLD2 = "0.4.48"
LazyArtifacts = "1.10"
Lux = "0.5.62"
LuxCore = "0.1.21"
MLDataDevices = "1.0.0"
Lux = "0.5.65"
LuxCore = "0.1.24"
MLDataDevices = "1.0.1"
Markdown = "1.10"
Metalhead = "0.9"
NNlib = "0.9.21"
Random = "1.10"
Reexport = "1.2.2"
Statistics = "1.10"
WeightInitializers = "0.1.7, 1"
WeightInitializers = "1"
Zygote = "0.6.70"
julia = "1.10"
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Boltz ⚡

[![Join the chat at https://julialang.zulipchat.com #machine-learning](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/machine-learning)
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://lux.csail.mit.edu/dev/api/Domain_Specific_Modeling/Boltz)
[![Stable Docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://lux.csail.mit.edu/stable/api/Domain_Specific_Modeling/Boltz)
[![GitHub Discussions](https://img.shields.io/github/discussions/LuxDL/Lux.jl?color=white&logo=github&label=Discussions)](https://github.com/LuxDL/Lux.jl/discussions)
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://luxdl.github.io/Boltz.jl/stable/)
[![Stable Docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://luxdl.github.io/Boltz.jl/dev/)

[![CI](https://github.com/LuxDL/Boltz.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/LuxDL/Boltz.jl/actions/workflows/CI.yml)
[![Build status](https://badge.buildkite.com/33d66eb556ba88f60e733e97ff65c133fdb5f0ac683e823cfb.svg?branch=main)](https://buildkite.com/julialang/boltz-dot-jl)
[![codecov](https://codecov.io/gh/LuxDL/Boltz.jl/branch/main/graph/badge.svg?token=YBImUxz5qO)](https://codecov.io/gh/LuxDL/Boltz.jl)
[![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Boltz)](https://pkgs.genieframework.com?packages=Boltz)

[![Downloads](https://img.shields.io/badge/dynamic/json?url=http%3A%2F%2Fjuliapkgstats.com%2Fapi%2Fv1%2Fmonthly_downloads%2FBoltz&query=total_requests&suffix=%2Fmonth&label=Downloads)](https://juliapkgstats.com/pkg/Boltz)
[![Downloads](https://img.shields.io/badge/dynamic/json?url=http%3A%2F%2Fjuliapkgstats.com%2Fapi%2Fv1%2Ftotal_downloads%2FBoltz&query=total_requests&&label=Total%20Downloads)](https://juliapkgstats.com/pkg/Boltz)

[![JET Testing](https://img.shields.io/badge/%F0%9F%9B%A9%EF%B8%8F_tested_with-JET.jl-233f9a)](https://github.com/aviatesk/JET.jl)
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)

Expand All @@ -25,20 +30,5 @@ Pkg.add("Boltz")
```julia
using Boltz, Lux, Metalhead

model, ps, st = resnet(:alexnet; pretrained=true)
model, ps, st = Vision.AlexNet(; pretrained=true)
```

## Changelog


### Updating from v0.2 to v0.3

CUDA is not loaded by default. To use GPUs follow
[Lux.jl documentation](https://lux.csail.mit.edu/stable/manual/gpu_management/).

### Updating from v0.1 to v0.2

We have moved some dependencies into weak dependencies. This means that you will have to
manually load them for certain features to be available.

* To load Flux & Metalhead models, do `using Metalhead`.
7 changes: 7 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
Boltz = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
42 changes: 42 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Documenter, DocumenterVitepress, DocumenterCitations, Boltz

#! format: off
pages = [
"Boltz.jl" => "index.md",
"Tutorials" => [
"Getting Started" => "tutorials/getting_started.md",
],
"API Reference" => [
"Index" => "api/index.md",
"Basis Functions" => "api/basis.md",
"Layers API" => "api/layers.md",
"Vision Models" => "api/vision.md",
"Private API" => "api/private.md",
]
]
#! format: on

bib = CitationBibliography(
joinpath(@__DIR__, "ref.bib");
style=:authoryear
)

deploy_config = Documenter.auto_detect_deploy_system()
deploy_decision = Documenter.deploy_folder(deploy_config; repo="github.com/LuxDL/Boltz.jl",
devbranch="main", devurl="dev", push_preview=true)

makedocs(; sitename="Boltz.jl Docs",
authors="Avik Pal et al.",
clean=true,
doctest=false, # We test it in the CI, no need to run it here
modules=[Boltz],
linkcheck=true,
repo="https://github.com/LuxDL/Boltz.jl/blob/{commit}{path}#{line}",
format=DocumenterVitepress.MarkdownVitepress(;
repo="github.com/LuxDL/Boltz.jl", devbranch="main", devurl="dev", deploy_decision),
draft=false,
plugins=[bib],
pages)

deploydocs(; repo="github.com/LuxDL/Boltz.jl.git",
push_preview=true, target="build", devbranch="main")
18 changes: 18 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"devDependencies": {
"markdown-it": "^14.1.0",
"markdown-it-mathjax3": "^4.3.2",
"vitepress": "^1.0.2",
"vitepress-plugin-tabs": "^0.5.0",
"vitest": "^1.3.0"
},
"scripts": {
"docs:dev": "vitepress dev build/.documenter",
"docs:build": "vitepress build build/.documenter",
"docs:preview": "vitepress preview build/.documenter"
},
"dependencies": {
"@shikijs/transformers": "^1.1.7",
"markdown-it-footnote": "^4.0.0"
}
}
91 changes: 91 additions & 0 deletions docs/ref.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
@article{dosovitskiy2020image,
title = {An image is worth 16x16 words: Transformers for image recognition at scale},
author = {Dosovitskiy, Alexey and Beyer, Lucas and Kolesnikov, Alexander and Weissenborn, Dirk and Zhai, Xiaohua and Unterthiner, Thomas and Dehghani, Mostafa and Minderer, Matthias and Heigold, Georg and Gelly, Sylvain and others},
journal = {arXiv preprint arXiv:2010.11929},
year = {2020}
}

@article{simonyan2014very,
title = {Very deep convolutional networks for large-scale image recognition},
author = {Simonyan, Karen},
journal = {arXiv preprint arXiv:1409.1556},
year = {2014}
}

@article{greydanus2019hamiltonian,
title = {Hamiltonian neural networks},
author = {Greydanus, Samuel and Dzamba, Misko and Yosinski, Jason},
journal = {Advances in neural information processing systems},
volume = {32},
year = {2019}
}

@article{krizhevsky2012imagenet,
title = {Imagenet classification with deep convolutional neural networks},
author = {Krizhevsky, Alex and Sutskever, Ilya and Hinton, Geoffrey E},
journal = {Advances in neural information processing systems},
volume = {25},
year = {2012}
}

@inproceedings{he2016deep,
title = {Deep residual learning for image recognition},
author = {He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
pages = {770--778},
year = {2016}
}

@inproceedings{xie2017aggregated,
title = {Aggregated residual transformations for deep neural networks},
author = {Xie, Saining and Girshick, Ross and Doll{\'a}r, Piotr and Tu, Zhuowen and He, Kaiming},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
pages = {1492--1500},
year = {2017}
}

@inproceedings{szegedy2015going,
title = {Going deeper with convolutions},
author = {Szegedy, Christian and Liu, Wei and Jia, Yangqing and Sermanet, Pierre and Reed, Scott and Anguelov, Dragomir and Erhan, Dumitru and Vanhoucke, Vincent and Rabinovich, Andrew},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
pages = {1--9},
year = {2015}
}

@inproceedings{huang2017densely,
title = {Densely connected convolutional networks},
author = {Huang, Gao and Liu, Zhuang and Van Der Maaten, Laurens and Weinberger, Kilian Q},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
pages = {4700--4708},
year = {2017}
}

@article{trockman2022patches,
title = {Patches are all you need?},
author = {Trockman, Asher and Kolter, J Zico},
journal = {arXiv preprint arXiv:2201.09792},
year = {2022}
}

@article{howard2017mobilenets,
title = {MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications},
author = {Howard, Andrew G},
journal = {arXiv preprint arXiv:1704.04861},
year = {2017}
}

@inproceedings{sandler2018mobilenetv2,
title = {Mobilenetv2: Inverted residuals and linear bottlenecks},
author = {Sandler, Mark and Howard, Andrew and Zhu, Menglong and Zhmoginov, Andrey and Chen, Liang-Chieh},
booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition},
pages = {4510--4520},
year = {2018}
}

@inproceedings{howard2019searching,
title = {Searching for mobilenetv3},
author = {Howard, Andrew and Sandler, Mark and Chu, Grace and Chen, Liang-Chieh and Chen, Bo and Tan, Mingxing and Wang, Weijun and Zhu, Yukun and Pang, Ruoming and Vasudevan, Vijay and others},
booktitle = {Proceedings of the IEEE/CVF international conference on computer vision},
pages = {1314--1324},
year = {2019}
}
Loading
Loading