Equimo 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. equimo-0.1.0/Equimo.egg-info/PKG-INFO +104 -0
  2. equimo-0.1.0/Equimo.egg-info/SOURCES.txt +32 -0
  3. equimo-0.1.0/Equimo.egg-info/dependency_links.txt +1 -0
  4. equimo-0.1.0/Equimo.egg-info/requires.txt +4 -0
  5. equimo-0.1.0/Equimo.egg-info/top_level.txt +1 -0
  6. equimo-0.1.0/LICENSE.md +21 -0
  7. equimo-0.1.0/PKG-INFO +104 -0
  8. equimo-0.1.0/README.md +92 -0
  9. equimo-0.1.0/equimo/__init__.py +0 -0
  10. equimo-0.1.0/equimo/layers/__init__.py +0 -0
  11. equimo-0.1.0/equimo/layers/attention.py +1526 -0
  12. equimo-0.1.0/equimo/layers/convolution.py +329 -0
  13. equimo-0.1.0/equimo/layers/downsample.py +58 -0
  14. equimo-0.1.0/equimo/layers/dropout.py +217 -0
  15. equimo-0.1.0/equimo/layers/ffn.py +184 -0
  16. equimo-0.1.0/equimo/layers/generic.py +68 -0
  17. equimo-0.1.0/equimo/layers/mamba.py +169 -0
  18. equimo-0.1.0/equimo/layers/norm.py +87 -0
  19. equimo-0.1.0/equimo/layers/patch.py +399 -0
  20. equimo-0.1.0/equimo/layers/posemb.py +416 -0
  21. equimo-0.1.0/equimo/layers/sharing.py +160 -0
  22. equimo-0.1.0/equimo/layers/squeeze_excite.py +143 -0
  23. equimo-0.1.0/equimo/models/__init__.py +7 -0
  24. equimo-0.1.0/equimo/models/emamodel.py +99 -0
  25. equimo-0.1.0/equimo/models/fastervit.py +488 -0
  26. equimo-0.1.0/equimo/models/mlla.py +166 -0
  27. equimo-0.1.0/equimo/models/partialformer.py +407 -0
  28. equimo-0.1.0/equimo/models/shvit.py +376 -0
  29. equimo-0.1.0/equimo/models/vit.py +472 -0
  30. equimo-0.1.0/equimo/models/vssd.py +189 -0
  31. equimo-0.1.0/equimo/ops/scan.py +246 -0
  32. equimo-0.1.0/equimo/utils.py +127 -0
  33. equimo-0.1.0/pyproject.toml +12 -0
  34. equimo-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.1
2
+ Name: Equimo
3
+ Version: 0.1.0
4
+ Summary: Implementation of popular vision models in Jax
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE.md
8
+ Requires-Dist: einops>=0.8.0
9
+ Requires-Dist: equinox>=0.11.5
10
+ Requires-Dist: jax>=0.4.25
11
+ Requires-Dist: jaxlib>=0.4.25
12
+
13
+ # Equimo: Modern Vision Models in JAX/Equinox
14
+
15
+ **WARNING**: This is a research library implementing recent computer vision models. The implementations are based on paper descriptions and may not be exact replicas of the original implementations. Use with caution in production environments.
16
+
17
+ Equimo (Equinox Image Models) provides JAX/Equinox implementations of recent computer vision models, currently focusing (but not limited to) on transformer and state-space architectures.
18
+
19
+ ## Features
20
+
21
+ - Pure JAX/Equinox implementations
22
+ - Focus on recent architectures (2023-2024 papers)
23
+ - Modular design for easy experimentation
24
+ - Extensive documentation and type hints
25
+
26
+ ## Installation
27
+
28
+ ### From PyPI
29
+
30
+ ```bash
31
+ pip install equimo
32
+ ```
33
+
34
+ ### From Source
35
+
36
+ ```bash
37
+ git clone https://github.com/clementpoiret/equimo.git
38
+ cd equimo
39
+ pip install -e .
40
+ ```
41
+
42
+ ## Implemented Models
43
+
44
+ | Model | Paper | Year | Status |
45
+ |-------|-------|------|--------|
46
+ | FasterViT | [FasterViT: Fast Vision Transformers with Hierarchical Attention](https://arxiv.org/abs/2306.06189) | 2023 | ✅ |
47
+ | Castling-ViT | [Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention During Vision Transformer Inference](https://arxiv.org/abs/2211.10526) | 2023 | Partial* |
48
+ | MLLA | [Mamba-like Linear Attention](https://arxiv.org/abs/2405.16605) | 2024 | ✅ |
49
+ | PartialFormer | [Efficient Vision Transformers with Partial Attention](https://eccv.ecva.net/virtual/2024/poster/1877) | 2024 | ✅ |
50
+ | SHViT | [SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design](https://arxiv.org/abs/2401.16456) | 2024 | ✅ |
51
+ | VSSD | [VSSD: Vision Mamba with Non-Causal State Space Duality](https://arxiv.org/abs/2407.18559) | 2024 | ✅ |
52
+
53
+ *: Only contains the [Linear Angular Attention](https://github.com/clementpoiret/Equimo/blob/f8fcc79e45ca65e9deb1d970c4286c0b8562f9c2/equimo/layers/attention.py#L1407) module. It is straight forward to build a ViT around it, but may require an additional `__call__` kwarg to control the `sparse_reg` bool.
54
+
55
+ ## Basic Usage
56
+
57
+ ```python
58
+ import jax
59
+
60
+ import equimo.models as em
61
+
62
+ # Create a model (e.g. `faster_vit_0_224`)
63
+ key = jax.random.PRNGKey(0)
64
+ model = em.FasterViT(
65
+ img_size=224,
66
+ in_channels=3,
67
+ dim=64,
68
+ in_dim=64,
69
+ depths=[2, 3, 6, 5],
70
+ num_heads=[2, 4, 8, 16],
71
+ hat=[False, False, True, False],
72
+ window_size=[7, 7, 7, 7],
73
+ ct_size=2,
74
+ key=key,
75
+ )
76
+
77
+ # Generate random input
78
+ x = jax.random.normal(key, (3, 224, 224))
79
+
80
+ # Run inference
81
+ output = model(x, enable_dropout=False, key=key)
82
+ ```
83
+
84
+ ## Contributing
85
+
86
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
87
+
88
+ ## License
89
+
90
+ This project is licensed under the MIT License - see the LICENSE file for details.
91
+
92
+ ## Citation
93
+
94
+ If you use Equimo in your research, please cite:
95
+
96
+ ```bibtex
97
+ @software{equimo2024,
98
+ author = {Clément POIRET},
99
+ title = {Equimo: Modern Vision Models in JAX/Equinox},
100
+ year = {2024},
101
+ publisher = {GitHub},
102
+ url = {https://github.com/clementpoiret/equimo}
103
+ }
104
+ ```
@@ -0,0 +1,32 @@
1
+ LICENSE.md
2
+ README.md
3
+ pyproject.toml
4
+ Equimo.egg-info/PKG-INFO
5
+ Equimo.egg-info/SOURCES.txt
6
+ Equimo.egg-info/dependency_links.txt
7
+ Equimo.egg-info/requires.txt
8
+ Equimo.egg-info/top_level.txt
9
+ equimo/__init__.py
10
+ equimo/utils.py
11
+ equimo/layers/__init__.py
12
+ equimo/layers/attention.py
13
+ equimo/layers/convolution.py
14
+ equimo/layers/downsample.py
15
+ equimo/layers/dropout.py
16
+ equimo/layers/ffn.py
17
+ equimo/layers/generic.py
18
+ equimo/layers/mamba.py
19
+ equimo/layers/norm.py
20
+ equimo/layers/patch.py
21
+ equimo/layers/posemb.py
22
+ equimo/layers/sharing.py
23
+ equimo/layers/squeeze_excite.py
24
+ equimo/models/__init__.py
25
+ equimo/models/emamodel.py
26
+ equimo/models/fastervit.py
27
+ equimo/models/mlla.py
28
+ equimo/models/partialformer.py
29
+ equimo/models/shvit.py
30
+ equimo/models/vit.py
31
+ equimo/models/vssd.py
32
+ equimo/ops/scan.py
@@ -0,0 +1,4 @@
1
+ einops>=0.8.0
2
+ equinox>=0.11.5
3
+ jax>=0.4.25
4
+ jaxlib>=0.4.25
@@ -0,0 +1 @@
1
+ equimo
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Clément POIRET
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
equimo-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.1
2
+ Name: Equimo
3
+ Version: 0.1.0
4
+ Summary: Implementation of popular vision models in Jax
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE.md
8
+ Requires-Dist: einops>=0.8.0
9
+ Requires-Dist: equinox>=0.11.5
10
+ Requires-Dist: jax>=0.4.25
11
+ Requires-Dist: jaxlib>=0.4.25
12
+
13
+ # Equimo: Modern Vision Models in JAX/Equinox
14
+
15
+ **WARNING**: This is a research library implementing recent computer vision models. The implementations are based on paper descriptions and may not be exact replicas of the original implementations. Use with caution in production environments.
16
+
17
+ Equimo (Equinox Image Models) provides JAX/Equinox implementations of recent computer vision models, currently focusing (but not limited to) on transformer and state-space architectures.
18
+
19
+ ## Features
20
+
21
+ - Pure JAX/Equinox implementations
22
+ - Focus on recent architectures (2023-2024 papers)
23
+ - Modular design for easy experimentation
24
+ - Extensive documentation and type hints
25
+
26
+ ## Installation
27
+
28
+ ### From PyPI
29
+
30
+ ```bash
31
+ pip install equimo
32
+ ```
33
+
34
+ ### From Source
35
+
36
+ ```bash
37
+ git clone https://github.com/clementpoiret/equimo.git
38
+ cd equimo
39
+ pip install -e .
40
+ ```
41
+
42
+ ## Implemented Models
43
+
44
+ | Model | Paper | Year | Status |
45
+ |-------|-------|------|--------|
46
+ | FasterViT | [FasterViT: Fast Vision Transformers with Hierarchical Attention](https://arxiv.org/abs/2306.06189) | 2023 | ✅ |
47
+ | Castling-ViT | [Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention During Vision Transformer Inference](https://arxiv.org/abs/2211.10526) | 2023 | Partial* |
48
+ | MLLA | [Mamba-like Linear Attention](https://arxiv.org/abs/2405.16605) | 2024 | ✅ |
49
+ | PartialFormer | [Efficient Vision Transformers with Partial Attention](https://eccv.ecva.net/virtual/2024/poster/1877) | 2024 | ✅ |
50
+ | SHViT | [SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design](https://arxiv.org/abs/2401.16456) | 2024 | ✅ |
51
+ | VSSD | [VSSD: Vision Mamba with Non-Causal State Space Duality](https://arxiv.org/abs/2407.18559) | 2024 | ✅ |
52
+
53
+ *: Only contains the [Linear Angular Attention](https://github.com/clementpoiret/Equimo/blob/f8fcc79e45ca65e9deb1d970c4286c0b8562f9c2/equimo/layers/attention.py#L1407) module. It is straight forward to build a ViT around it, but may require an additional `__call__` kwarg to control the `sparse_reg` bool.
54
+
55
+ ## Basic Usage
56
+
57
+ ```python
58
+ import jax
59
+
60
+ import equimo.models as em
61
+
62
+ # Create a model (e.g. `faster_vit_0_224`)
63
+ key = jax.random.PRNGKey(0)
64
+ model = em.FasterViT(
65
+ img_size=224,
66
+ in_channels=3,
67
+ dim=64,
68
+ in_dim=64,
69
+ depths=[2, 3, 6, 5],
70
+ num_heads=[2, 4, 8, 16],
71
+ hat=[False, False, True, False],
72
+ window_size=[7, 7, 7, 7],
73
+ ct_size=2,
74
+ key=key,
75
+ )
76
+
77
+ # Generate random input
78
+ x = jax.random.normal(key, (3, 224, 224))
79
+
80
+ # Run inference
81
+ output = model(x, enable_dropout=False, key=key)
82
+ ```
83
+
84
+ ## Contributing
85
+
86
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
87
+
88
+ ## License
89
+
90
+ This project is licensed under the MIT License - see the LICENSE file for details.
91
+
92
+ ## Citation
93
+
94
+ If you use Equimo in your research, please cite:
95
+
96
+ ```bibtex
97
+ @software{equimo2024,
98
+ author = {Clément POIRET},
99
+ title = {Equimo: Modern Vision Models in JAX/Equinox},
100
+ year = {2024},
101
+ publisher = {GitHub},
102
+ url = {https://github.com/clementpoiret/equimo}
103
+ }
104
+ ```
equimo-0.1.0/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # Equimo: Modern Vision Models in JAX/Equinox
2
+
3
+ **WARNING**: This is a research library implementing recent computer vision models. The implementations are based on paper descriptions and may not be exact replicas of the original implementations. Use with caution in production environments.
4
+
5
+ Equimo (Equinox Image Models) provides JAX/Equinox implementations of recent computer vision models, currently focusing (but not limited to) on transformer and state-space architectures.
6
+
7
+ ## Features
8
+
9
+ - Pure JAX/Equinox implementations
10
+ - Focus on recent architectures (2023-2024 papers)
11
+ - Modular design for easy experimentation
12
+ - Extensive documentation and type hints
13
+
14
+ ## Installation
15
+
16
+ ### From PyPI
17
+
18
+ ```bash
19
+ pip install equimo
20
+ ```
21
+
22
+ ### From Source
23
+
24
+ ```bash
25
+ git clone https://github.com/clementpoiret/equimo.git
26
+ cd equimo
27
+ pip install -e .
28
+ ```
29
+
30
+ ## Implemented Models
31
+
32
+ | Model | Paper | Year | Status |
33
+ |-------|-------|------|--------|
34
+ | FasterViT | [FasterViT: Fast Vision Transformers with Hierarchical Attention](https://arxiv.org/abs/2306.06189) | 2023 | ✅ |
35
+ | Castling-ViT | [Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention During Vision Transformer Inference](https://arxiv.org/abs/2211.10526) | 2023 | Partial* |
36
+ | MLLA | [Mamba-like Linear Attention](https://arxiv.org/abs/2405.16605) | 2024 | ✅ |
37
+ | PartialFormer | [Efficient Vision Transformers with Partial Attention](https://eccv.ecva.net/virtual/2024/poster/1877) | 2024 | ✅ |
38
+ | SHViT | [SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design](https://arxiv.org/abs/2401.16456) | 2024 | ✅ |
39
+ | VSSD | [VSSD: Vision Mamba with Non-Causal State Space Duality](https://arxiv.org/abs/2407.18559) | 2024 | ✅ |
40
+
41
+ *: Only contains the [Linear Angular Attention](https://github.com/clementpoiret/Equimo/blob/f8fcc79e45ca65e9deb1d970c4286c0b8562f9c2/equimo/layers/attention.py#L1407) module. It is straight forward to build a ViT around it, but may require an additional `__call__` kwarg to control the `sparse_reg` bool.
42
+
43
+ ## Basic Usage
44
+
45
+ ```python
46
+ import jax
47
+
48
+ import equimo.models as em
49
+
50
+ # Create a model (e.g. `faster_vit_0_224`)
51
+ key = jax.random.PRNGKey(0)
52
+ model = em.FasterViT(
53
+ img_size=224,
54
+ in_channels=3,
55
+ dim=64,
56
+ in_dim=64,
57
+ depths=[2, 3, 6, 5],
58
+ num_heads=[2, 4, 8, 16],
59
+ hat=[False, False, True, False],
60
+ window_size=[7, 7, 7, 7],
61
+ ct_size=2,
62
+ key=key,
63
+ )
64
+
65
+ # Generate random input
66
+ x = jax.random.normal(key, (3, 224, 224))
67
+
68
+ # Run inference
69
+ output = model(x, enable_dropout=False, key=key)
70
+ ```
71
+
72
+ ## Contributing
73
+
74
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
75
+
76
+ ## License
77
+
78
+ This project is licensed under the MIT License - see the LICENSE file for details.
79
+
80
+ ## Citation
81
+
82
+ If you use Equimo in your research, please cite:
83
+
84
+ ```bibtex
85
+ @software{equimo2024,
86
+ author = {Clément POIRET},
87
+ title = {Equimo: Modern Vision Models in JAX/Equinox},
88
+ year = {2024},
89
+ publisher = {GitHub},
90
+ url = {https://github.com/clementpoiret/equimo}
91
+ }
92
+ ```
File without changes
File without changes