Equimo 0.4.1__tar.gz → 0.4.3__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.
- {equimo-0.4.1/src/Equimo.egg-info → equimo-0.4.3}/PKG-INFO +1 -1
- {equimo-0.4.1 → equimo-0.4.3}/pyproject.toml +1 -1
- {equimo-0.4.1 → equimo-0.4.3/src/Equimo.egg-info}/PKG-INFO +1 -1
- equimo-0.4.3/src/equimo/__init__.py +1 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/attention.py +12 -13
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/reduceformer.py +5 -4
- equimo-0.4.1/src/equimo/__init__.py +0 -1
- {equimo-0.4.1 → equimo-0.4.3}/LICENSE.md +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/README.md +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/setup.cfg +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/Equimo.egg-info/SOURCES.txt +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/Equimo.egg-info/dependency_links.txt +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/Equimo.egg-info/requires.txt +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/Equimo.egg-info/top_level.txt +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/conversion/__init__.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/conversion/utils.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/experimental/__init__.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/experimental/text.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/io.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/__init__.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/activation.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/convolution.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/downsample.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/dropout.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/ffn.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/generic.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/mamba.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/norm.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/patch.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/posemb.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/sharing.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/layers/squeeze_excite.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/__init__.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/emamodel.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/fastervit.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/lowformer.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/mlla.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/partialformer.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/shvit.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/vit.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/models/vssd.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/ops/scan.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/src/equimo/utils.py +0 -0
- {equimo-0.4.1 → equimo-0.4.3}/tests/test_models.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.3"
|
|
@@ -1766,6 +1766,8 @@ class RFAttention(eqx.Module):
|
|
|
1766
1766
|
|
|
1767
1767
|
|
|
1768
1768
|
class RFAttentionBlock(eqx.Module):
|
|
1769
|
+
residual: bool = eqx.field(static=True)
|
|
1770
|
+
|
|
1769
1771
|
context_module: RFAttention
|
|
1770
1772
|
local_module: MBConv
|
|
1771
1773
|
drop_path1: DropPathAdd
|
|
@@ -1789,9 +1791,11 @@ class RFAttentionBlock(eqx.Module):
|
|
|
1789
1791
|
local_drop: float = 0.0,
|
|
1790
1792
|
drop_path: float | List[float] = 0.0,
|
|
1791
1793
|
residual_mbconv: bool = False,
|
|
1794
|
+
residual: bool = True,
|
|
1792
1795
|
**kwargs,
|
|
1793
1796
|
):
|
|
1794
1797
|
key_context, key_local = jr.split(key, 2)
|
|
1798
|
+
self.residual = residual
|
|
1795
1799
|
|
|
1796
1800
|
if isinstance(drop_path, list):
|
|
1797
1801
|
if len(drop_path) != 2:
|
|
@@ -1841,20 +1845,15 @@ class RFAttentionBlock(eqx.Module):
|
|
|
1841
1845
|
key_context, key_local, key_dr1, key_dr2 = jr.split(key, 4)
|
|
1842
1846
|
|
|
1843
1847
|
# TODO: some prenorm?
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
self.
|
|
1847
|
-
inference=inference,
|
|
1848
|
-
key=key_dr1,
|
|
1849
|
-
)
|
|
1850
|
-
x = self.drop_path2(
|
|
1851
|
-
x,
|
|
1852
|
-
self.local_module(x, inference=inference, key=key_local),
|
|
1853
|
-
inference=inference,
|
|
1854
|
-
key=key_dr2,
|
|
1855
|
-
)
|
|
1848
|
+
x1 = self.context_module(x, inference=inference, key=key_context)
|
|
1849
|
+
if self.residual:
|
|
1850
|
+
x1 = self.drop_path1(x, x1, inference=inference, key=key_dr1)
|
|
1856
1851
|
|
|
1857
|
-
|
|
1852
|
+
x2 = self.local_module(x, inference=inference, key=key_local)
|
|
1853
|
+
if self.residual:
|
|
1854
|
+
x2 = self.drop_path2(x1, x2, inference=inference, key=key_dr2)
|
|
1855
|
+
|
|
1856
|
+
return x2
|
|
1858
1857
|
|
|
1859
1858
|
|
|
1860
1859
|
class ConvAttention(eqx.Module):
|
|
@@ -159,7 +159,7 @@ class ReduceFormer(eqx.Module):
|
|
|
159
159
|
block_types: list[Literal["conv", "attention"]],
|
|
160
160
|
*,
|
|
161
161
|
key: PRNGKeyArray,
|
|
162
|
-
|
|
162
|
+
head_dim: int = 32,
|
|
163
163
|
expand_ratio: float = 4.0,
|
|
164
164
|
norm_layer: eqx.Module | str = eqx.nn.GroupNorm,
|
|
165
165
|
act_layer: Callable | str = jax.nn.hard_swish,
|
|
@@ -227,6 +227,7 @@ class ReduceFormer(eqx.Module):
|
|
|
227
227
|
depth=depth,
|
|
228
228
|
block_type=block_type,
|
|
229
229
|
stride=2,
|
|
230
|
+
head_dim=head_dim,
|
|
230
231
|
expand_ratio=expand_ratio,
|
|
231
232
|
norm_layer=norm_layer,
|
|
232
233
|
act_layer=act_layer,
|
|
@@ -335,7 +336,7 @@ def reduceformer_backbone_b1(**kwargs) -> ReduceFormer:
|
|
|
335
336
|
"attention",
|
|
336
337
|
"attention",
|
|
337
338
|
],
|
|
338
|
-
|
|
339
|
+
head_dim=16,
|
|
339
340
|
**kwargs,
|
|
340
341
|
)
|
|
341
342
|
return backbone
|
|
@@ -352,7 +353,7 @@ def reduceformer_backbone_b2(**kwargs) -> ReduceFormer:
|
|
|
352
353
|
"attention",
|
|
353
354
|
"attention",
|
|
354
355
|
],
|
|
355
|
-
|
|
356
|
+
head_dim=32,
|
|
356
357
|
**kwargs,
|
|
357
358
|
)
|
|
358
359
|
return backbone
|
|
@@ -369,7 +370,7 @@ def reduceformer_backbone_b3(**kwargs) -> ReduceFormer:
|
|
|
369
370
|
"attention",
|
|
370
371
|
"attention",
|
|
371
372
|
],
|
|
372
|
-
|
|
373
|
+
head_dim=32,
|
|
373
374
|
**kwargs,
|
|
374
375
|
)
|
|
375
376
|
return backbone
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|