hyper-connections 0.2.0__py3-none-any.whl → 0.2.1__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.
- hyper_connections/hyper_connections.py +3 -1
- hyper_connections/hyper_connections_channel_first.py +3 -1
- hyper_connections/hyper_connections_with_multi_branch_inputs.py +3 -1
- hyper_connections/hyper_connections_with_multi_input_streams.py +3 -1
- {hyper_connections-0.2.0.dist-info → hyper_connections-0.2.1.dist-info}/METADATA +2 -2
- hyper_connections-0.2.1.dist-info/RECORD +10 -0
- hyper_connections-0.2.0.dist-info/RECORD +0 -10
- {hyper_connections-0.2.0.dist-info → hyper_connections-0.2.1.dist-info}/WHEEL +0 -0
- {hyper_connections-0.2.0.dist-info → hyper_connections-0.2.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -67,8 +67,10 @@ def get_init_and_expand_reduce_stream_functions(
|
|
|
67
67
|
num_fracs = 1,
|
|
68
68
|
dim = None,
|
|
69
69
|
add_stream_embed = False,
|
|
70
|
-
disable =
|
|
70
|
+
disable = None
|
|
71
71
|
):
|
|
72
|
+
disable = default(disable, num_streams == 1 and num_fracs == 1)
|
|
73
|
+
|
|
72
74
|
hyper_conn_klass = HyperConnections if not disable else Residual
|
|
73
75
|
|
|
74
76
|
init_hyper_conn_fn = partial(hyper_conn_klass, num_streams, num_fracs = num_fracs)
|
|
@@ -49,7 +49,9 @@ def get_expand_reduce_stream_functions(num_streams, disable = False):
|
|
|
49
49
|
|
|
50
50
|
return expand_fn, reduce_fn
|
|
51
51
|
|
|
52
|
-
def get_init_and_expand_reduce_stream_functions(num_streams, disable =
|
|
52
|
+
def get_init_and_expand_reduce_stream_functions(num_streams, disable = None):
|
|
53
|
+
|
|
54
|
+
disable = default(disable, num_streams == 1)
|
|
53
55
|
|
|
54
56
|
hyper_conn_klass = HyperConnections if not disable else Residual
|
|
55
57
|
|
|
@@ -50,7 +50,9 @@ def get_expand_reduce_stream_functions(cls, num_streams, disable = False):
|
|
|
50
50
|
|
|
51
51
|
return expand_fn, reduce_fn
|
|
52
52
|
|
|
53
|
-
def get_init_and_expand_reduce_stream_functions(cls, num_streams, disable =
|
|
53
|
+
def get_init_and_expand_reduce_stream_functions(cls, num_streams, disable = None):
|
|
54
|
+
|
|
55
|
+
disable = default(disable, num_streams == 1)
|
|
54
56
|
|
|
55
57
|
hyper_conn_klass = HyperConnections if not disable else Residual
|
|
56
58
|
|
|
@@ -41,7 +41,9 @@ def get_expand_reduce_stream_functions(num_streams, disable = False):
|
|
|
41
41
|
|
|
42
42
|
return expand_fn, reduce_fn
|
|
43
43
|
|
|
44
|
-
def get_init_and_expand_reduce_stream_functions(num_streams, disable =
|
|
44
|
+
def get_init_and_expand_reduce_stream_functions(num_streams, disable = None):
|
|
45
|
+
|
|
46
|
+
disable = default(disable, num_streams == 1)
|
|
45
47
|
|
|
46
48
|
hyper_conn_klass = HyperConnections if not disable else Residual
|
|
47
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyper-connections
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
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
|
|
@@ -141,7 +141,7 @@ To compare hyper connections to plain residual without changing the code, just p
|
|
|
141
141
|
get_init_and_expand_reduce_stream_functions(4, disable = True)
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
To use the fractionated feature dimensions proposed in
|
|
144
|
+
To use the fractionated feature dimensions proposed in [a follow up paper](https://arxiv.org/abs/2503.14125) by same authors, just instantiate with `num_fracs` greater than `1` as so
|
|
145
145
|
|
|
146
146
|
```python
|
|
147
147
|
get_init_and_expand_reduce_stream_functions(1, num_fracs = 4) # also allows you to mix streams and fractions of feature dimension
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
hyper_connections/__init__.py,sha256=d2zNTka0Gp9vINu4U-RhgTJFBhsVrs1fne_15Zl0oOs,224
|
|
2
|
+
hyper_connections/hyper_connections.py,sha256=UHxZhyRwx89GRgmQVt53Gv6JeNhX8UCjjETlydMZjTk,15021
|
|
3
|
+
hyper_connections/hyper_connections_channel_first.py,sha256=_1PM4LRcPpDqfCiHlBMc2nLV08sXM2nuyZGSKTiuqbE,6818
|
|
4
|
+
hyper_connections/hyper_connections_with_multi_branch_inputs.py,sha256=6BXKdSwyx6wdQVseebKG2EQkhVaVLrrepOlL8lLnex4,7855
|
|
5
|
+
hyper_connections/hyper_connections_with_multi_input_streams.py,sha256=ueT3CJPHrt5hRU7q1bFF0rANWJh_pXqclt6HiUu1gBY,11331
|
|
6
|
+
hyper_connections/residuals.py,sha256=JVSFJj_H7xQ3_Fd-pZH5Hdv9SveAQu29jQNvMyom5ek,921
|
|
7
|
+
hyper_connections-0.2.1.dist-info/METADATA,sha256=MJU_T9w23XcVFmETbIXfKjNyzArjOD26Z4LYKFbnOrI,5966
|
|
8
|
+
hyper_connections-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
hyper_connections-0.2.1.dist-info/licenses/LICENSE,sha256=E7RGS7kpJIStk5za_-4DVhWEAamf65EU0CNML25mq4c,1066
|
|
10
|
+
hyper_connections-0.2.1.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
hyper_connections/__init__.py,sha256=d2zNTka0Gp9vINu4U-RhgTJFBhsVrs1fne_15Zl0oOs,224
|
|
2
|
-
hyper_connections/hyper_connections.py,sha256=iMKJBJioaPus6QcR50nwdDrIs96P1liyktC5RE6Drds,14953
|
|
3
|
-
hyper_connections/hyper_connections_channel_first.py,sha256=BojfO2dcT4jX1rlcU3kr0B6B_CjrkkS2AZU4ZXeWvh8,6769
|
|
4
|
-
hyper_connections/hyper_connections_with_multi_branch_inputs.py,sha256=2JABz1slrF5_XP33L1CMNTmmixfoD464FtQpUADqneU,7806
|
|
5
|
-
hyper_connections/hyper_connections_with_multi_input_streams.py,sha256=UIKceEZEBLKFL5VuP5tR1KTDeZNIJEKjFuPAwXkcp0I,11282
|
|
6
|
-
hyper_connections/residuals.py,sha256=JVSFJj_H7xQ3_Fd-pZH5Hdv9SveAQu29jQNvMyom5ek,921
|
|
7
|
-
hyper_connections-0.2.0.dist-info/METADATA,sha256=Ypr8d84gZhK_SB-nFhOm5s3VP_-1if4JB39f_vBf6oc,5966
|
|
8
|
-
hyper_connections-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
-
hyper_connections-0.2.0.dist-info/licenses/LICENSE,sha256=E7RGS7kpJIStk5za_-4DVhWEAamf65EU0CNML25mq4c,1066
|
|
10
|
-
hyper_connections-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|