Skip to content

Commit

Permalink
More API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jun 11, 2024
1 parent f7f4551 commit bb41d0c
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 69 deletions.
4 changes: 3 additions & 1 deletion docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export default defineConfig({
},
{
text: 'Domain Specific Modeling', collapsed: false, items: [
{ text: 'Boltz', link: '/api/Domain_Specific_Modeling/Boltz' }]
{ text: 'Boltz', link: '/api/Domain_Specific_Modeling/Boltz' },
{ text: 'Computer Vision', link: '/api/Domain_Specific_Modeling/Boltz_Vision' },
{ text: 'Boltz.Layers', link: '/api/Domain_Specific_Modeling/Boltz_Layers' }]
},
{
text: 'Testing Functionality', collapsed: false, items: [
Expand Down
69 changes: 1 addition & 68 deletions docs/src/api/Domain_Specific_Modeling/Boltz.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,5 @@ Accelerate ⚡ your ML research using pre-built Deep Learning Models with Lux.
## Index

```@index
Pages = ["Boltz.md"]
```

## `Layers` API

```@docs
Layers.ConvBatchNormActivation
Layers.ClassTokens
Layers.MultiHeadSelfAttention
Layers.ViPosEmbedding
Layers.VisionTransformerEncoder
```

## Computer Vision Models (`Vision` API)

### Native Lux Models

```@docs
Vision.VGG
Vision.VisionTransformer
```

### Imported from Metalhead.jl

!!! tip

You need to load `Flux` and `Metalhead` before using these models.

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

### Pretrained Models

!!! tip

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 |

#### Preprocessing

All the pretrained models require that the images be normalized with the parameters
`mean = [0.485f0, 0.456f0, 0.406f0]` and `std = [0.229f0, 0.224f0, 0.225f0]`.

## Non-Public API

```@docs
Boltz._seconddimmean
Boltz._fast_chunk
Boltz._flatten_spatial
Pages = ["Boltz.md", "Boltz_Layers.md", "Boltz_Vision.md"]
```
36 changes: 36 additions & 0 deletions docs/src/api/Domain_Specific_Modeling/Boltz_Layers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```@meta
CurrentModule = Boltz
```

# `Boltz.Layers` and `Boltz.Basis` API Reference

## `Layers` API

```@docs
Layers.ConvBatchNormActivation
Layers.ConvNormActivation
Layers.ClassTokens
Layers.HamiltonianNN
Layers.MultiHeadSelfAttention
Layers.MLP
Layers.TensorProductLayer
Layers.ViPosEmbedding
Layers.VisionTransformerEncoder
```

## Basis Functions

!!! warning

The function calls for these basis functions should be considered experimental and are
subject to change without deprecation. However, the functions themselves are stable
and can be freely used in combination with the other Layers and Models.

```@docs
Basis.Cos
Basis.Chebychev
Basis.Fourier
Basis.Legendre
Basis.Polynomial
Basis.Sin
```
12 changes: 12 additions & 0 deletions docs/src/api/Domain_Specific_Modeling/Boltz_Private.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```@meta
CurrentModule = Boltz
```

# Boltz.jl Private API

```@docs
Boltz._seconddimmean
Boltz._should_type_assert
Boltz._fast_chunk
Boltz._flatten_spatial
```
52 changes: 52 additions & 0 deletions docs/src/api/Domain_Specific_Modeling/Boltz_Vision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
```@meta
CurrentModule = Boltz
```

# Computer Vision Models (`Vision` API)

## Native Lux Models

```@docs
Vision.VGG
Vision.VisionTransformer
```

## Imported from Metalhead.jl

!!! tip

You need to load `Flux` and `Metalhead` before using these models.

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

## Pretrained Models

!!! tip

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 |

### Preprocessing

All the pretrained models require that the images be normalized with the parameters
`mean = [0.485f0, 0.456f0, 0.406f0]` and `std = [0.229f0, 0.224f0, 0.225f0]`.

0 comments on commit bb41d0c

Please sign in to comment.