hyper-connections 0.3.4__py3-none-any.whl → 0.3.5__py3-none-any.whl

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.
@@ -10,7 +10,7 @@ import torch.nn.functional as F
10
10
  from torch.nn import Module, Sequential
11
11
  from torch.utils._pytree import tree_flatten, tree_unflatten
12
12
 
13
- from einops import rearrange, repeat, reduce, einsum, pack, unpack
13
+ from einops import rearrange, repeat, reduce, einsum
14
14
  from einops.layers.torch import Rearrange, Reduce
15
15
 
16
16
  """
@@ -40,14 +40,6 @@ def identity(t):
40
40
  def add(x, y):
41
41
  return x + y
42
42
 
43
- def pack_one_with_inverse(t, pattern):
44
- packed, packed_shape = pack([t], pattern)
45
-
46
- def inverse(out):
47
- return unpack(out, packed_shape, pattern)[0]
48
-
49
- return packed, inverse
50
-
51
43
  # sinkhorn
52
44
 
53
45
  def l1norm(t, dim):
@@ -320,11 +312,11 @@ class ManifoldConstrainedHyperConnections(Module):
320
312
 
321
313
  # norm
322
314
 
323
- flattened_residuals, inverse_pack = pack_one_with_inverse(residuals, 'b n *')
315
+ normed = rearrange(residuals, 'b ... f s d -> b ... (f s d)')
324
316
 
325
- normed = self.norm(flattened_residuals) # they norm across flattened stream + dimension?
317
+ normed = self.norm(normed)
326
318
 
327
- normed = inverse_pack(normed)
319
+ normed = rearrange(normed, 'b ... (f s d) -> b ... f s d', f = self.num_fracs, s = streams)
328
320
 
329
321
  # alpha for weighted sum of residuals going into branch
330
322
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyper-connections
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Hyper-Connections
5
5
  Project-URL: Homepage, https://pypi.org/project/hyper-connections/
6
6
  Project-URL: Repository, https://github.com/lucidrains/hyper-connections
@@ -45,6 +45,8 @@ Description-Content-Type: text/markdown
45
45
 
46
46
  Attempt to make multiple residual streams, proposed in [Hyper-Connections paper](https://arxiv.org/abs/2409.19606) out of Bytedance AI lab, accessible as an easy to use library, as well as for following any new research in this direction.
47
47
 
48
+ [Write up on mHC from Subhadip Mitra](https://subhadipmitra.com/blog/2026/deepseek-mhc-manifold-constrained-hyper-connections/)
49
+
48
50
  ## Install
49
51
 
50
52
  ```bash
@@ -3,9 +3,9 @@ hyper_connections/hyper_connections.py,sha256=UHxZhyRwx89GRgmQVt53Gv6JeNhX8UCjjE
3
3
  hyper_connections/hyper_connections_channel_first.py,sha256=_1PM4LRcPpDqfCiHlBMc2nLV08sXM2nuyZGSKTiuqbE,6818
4
4
  hyper_connections/hyper_connections_with_multi_branch_inputs.py,sha256=6BXKdSwyx6wdQVseebKG2EQkhVaVLrrepOlL8lLnex4,7855
5
5
  hyper_connections/hyper_connections_with_multi_input_streams.py,sha256=ueT3CJPHrt5hRU7q1bFF0rANWJh_pXqclt6HiUu1gBY,11331
6
- hyper_connections/manifold_constrained_hyper_connections.py,sha256=5JDrXPOKqzwQLdmp8tft7q7SOws5tD4r8MFKFQFEoLU,16976
6
+ hyper_connections/manifold_constrained_hyper_connections.py,sha256=rW4LKNDvq1MPT3ou8ZL7GHgbZGUb62iPqqLreGH31o0,16756
7
7
  hyper_connections/residuals.py,sha256=JVSFJj_H7xQ3_Fd-pZH5Hdv9SveAQu29jQNvMyom5ek,921
8
- hyper_connections-0.3.4.dist-info/METADATA,sha256=2XGPVmM9gAYU3Mtk-1DtsCdawxkJ2p9k6MaB2Hj-E0E,6575
9
- hyper_connections-0.3.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
- hyper_connections-0.3.4.dist-info/licenses/LICENSE,sha256=E7RGS7kpJIStk5za_-4DVhWEAamf65EU0CNML25mq4c,1066
11
- hyper_connections-0.3.4.dist-info/RECORD,,
8
+ hyper_connections-0.3.5.dist-info/METADATA,sha256=3h4jwNOJaX08sNUhqKiKaFNyTN0Yerq31nV3lghgDpo,6704
9
+ hyper_connections-0.3.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
10
+ hyper_connections-0.3.5.dist-info/licenses/LICENSE,sha256=E7RGS7kpJIStk5za_-4DVhWEAamf65EU0CNML25mq4c,1066
11
+ hyper_connections-0.3.5.dist-info/RECORD,,