hyper-connections 0.1.14__tar.gz → 0.1.15__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyper-connections
3
- Version: 0.1.14
3
+ Version: 0.1.15
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
@@ -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, ps = pack([x], '* d')
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, ps, '* d')
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
- self.to_learned_mix = nn.Linear(dim * 2, dim)
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 *')
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hyper-connections"
3
- version = "0.1.14"
3
+ version = "0.1.15"
4
4
  description = "Hyper-Connections"
5
5
  authors = [
6
6
  { name = "Phil Wang", email = "lucidrains@gmail.com" }