hyper-connections 0.1.14__py3-none-any.whl → 0.1.15__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/residuals.py +6 -4
- {hyper_connections-0.1.14.dist-info → hyper_connections-0.1.15.dist-info}/METADATA +1 -1
- {hyper_connections-0.1.14.dist-info → hyper_connections-0.1.15.dist-info}/RECORD +5 -5
- {hyper_connections-0.1.14.dist-info → hyper_connections-0.1.15.dist-info}/WHEEL +0 -0
- {hyper_connections-0.1.14.dist-info → hyper_connections-0.1.15.dist-info}/licenses/LICENSE +0 -0
hyper_connections/residuals.py
CHANGED
|
@@ -13,21 +13,23 @@ class GRUGatedResidual(Module):
|
|
|
13
13
|
self.gru = nn.GRUCell(dim, dim)
|
|
14
14
|
|
|
15
15
|
def forward(self, x, residual):
|
|
16
|
-
x,
|
|
16
|
+
x, packed_shape = pack([x], '* d')
|
|
17
17
|
residual, _ = pack([residual], '* d')
|
|
18
18
|
|
|
19
19
|
output = self.gru(x, residual)
|
|
20
20
|
|
|
21
|
-
output, = unpack(output,
|
|
21
|
+
output, = unpack(output, packed_shape, '* d')
|
|
22
22
|
return output
|
|
23
23
|
|
|
24
24
|
class GatedResidual(Module):
|
|
25
25
|
def __init__(
|
|
26
26
|
self,
|
|
27
|
-
dim
|
|
27
|
+
dim,
|
|
28
|
+
fine_gate = False
|
|
28
29
|
):
|
|
29
30
|
super().__init__()
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
self.to_learned_mix = nn.Linear(dim * 2, dim if fine_gate else 1)
|
|
31
33
|
|
|
32
34
|
def forward(self, x, residual):
|
|
33
35
|
x_and_residual, _ = pack([x, residual], 'b n *')
|
|
@@ -3,8 +3,8 @@ hyper_connections/hyper_connections.py,sha256=vpipBRUGgYQ2qLBtT4Ws-myJYVdkQDkN3I
|
|
|
3
3
|
hyper_connections/hyper_connections_channel_first.py,sha256=BojfO2dcT4jX1rlcU3kr0B6B_CjrkkS2AZU4ZXeWvh8,6769
|
|
4
4
|
hyper_connections/hyper_connections_with_multi_branch_inputs.py,sha256=2JABz1slrF5_XP33L1CMNTmmixfoD464FtQpUADqneU,7806
|
|
5
5
|
hyper_connections/hyper_connections_with_multi_input_streams.py,sha256=UIKceEZEBLKFL5VuP5tR1KTDeZNIJEKjFuPAwXkcp0I,11282
|
|
6
|
-
hyper_connections/residuals.py,sha256=
|
|
7
|
-
hyper_connections-0.1.
|
|
8
|
-
hyper_connections-0.1.
|
|
9
|
-
hyper_connections-0.1.
|
|
10
|
-
hyper_connections-0.1.
|
|
6
|
+
hyper_connections/residuals.py,sha256=JVSFJj_H7xQ3_Fd-pZH5Hdv9SveAQu29jQNvMyom5ek,921
|
|
7
|
+
hyper_connections-0.1.15.dist-info/METADATA,sha256=mpJcQojJGcidK01FMdKR81rU3FH9OdFMDZu8ddgr11Q,5231
|
|
8
|
+
hyper_connections-0.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
hyper_connections-0.1.15.dist-info/licenses/LICENSE,sha256=E7RGS7kpJIStk5za_-4DVhWEAamf65EU0CNML25mq4c,1066
|
|
10
|
+
hyper_connections-0.1.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|