metacontroller-pytorch 0.0.1__py3-none-any.whl → 0.0.2__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.
@@ -49,6 +49,7 @@ class MetaController(Module):
49
49
  self,
50
50
  dim_latent,
51
51
  *,
52
+ switch_per_latent_dim = True,
52
53
  decoder_expansion_factor = 2.,
53
54
  decoder_depth = 1,
54
55
  hypernetwork_low_rank = 16,
@@ -70,8 +71,10 @@ class MetaController(Module):
70
71
 
71
72
  # switching unit
72
73
 
74
+ self.switch_per_latent_dim = switch_per_latent_dim
75
+
73
76
  self.switching_unit = GRU(dim_latent, dim_latent)
74
- self.to_switching_unit_beta = nn.Linear(dim_latent, 1, bias = False)
77
+ self.to_switching_unit_beta = nn.Linear(dim_latent, dim_latent if switch_per_latent_dim else 1, bias = False)
75
78
 
76
79
  self.switch_gating = AssocScan(**assoc_scan_kwargs)
77
80
 
@@ -154,7 +157,7 @@ class MetaController(Module):
154
157
  switch_beta = self.to_switching_unit_beta(switching_unit_gru_out).sigmoid()
155
158
 
156
159
  action_intent_for_gating = rearrange(sampled_action_intents, 'b n d -> (b d) n')
157
- switch_beta = repeat(switch_beta, 'b n 1 -> (b d) n', d = dim)
160
+ switch_beta = repeat(switch_beta, 'b n d -> (b r d) n', r = dim if not self.switch_per_latent_dim else 1)
158
161
 
159
162
  forget = 1. - switch_beta
160
163
  gated_action_intent = self.switch_gating(action_intent_for_gating * forget, switch_beta)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacontroller-pytorch
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Transformer Metacontroller
5
5
  Project-URL: Homepage, https://pypi.org/project/metacontroller/
6
6
  Project-URL: Repository, https://github.com/lucidrains/metacontroller
@@ -0,0 +1,6 @@
1
+ metacontroller/__init__.py,sha256=lj7IOGpN--qMxJWbB-4SGqoPXG7Hd4mgtToTRSyTZ58,57
2
+ metacontroller/metacontroller.py,sha256=VkTl7xHwAW1RSkWNdaMpcJ9kSqcIME-5vK9otEzGocc,7899
3
+ metacontroller_pytorch-0.0.2.dist-info/METADATA,sha256=76qLimsKlE06NLg6XdyE_eKsmBzqxwjL-F0zW0XEoGk,3706
4
+ metacontroller_pytorch-0.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
5
+ metacontroller_pytorch-0.0.2.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
6
+ metacontroller_pytorch-0.0.2.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- metacontroller/__init__.py,sha256=lj7IOGpN--qMxJWbB-4SGqoPXG7Hd4mgtToTRSyTZ58,57
2
- metacontroller/metacontroller.py,sha256=Pyv6iNGj8qyNKTF8AVHo9MK-Jg8g7A0xo5jZTeSU4Ys,7717
3
- metacontroller_pytorch-0.0.1.dist-info/METADATA,sha256=PuTRLQAP7vDagLO4f_bSQJJDS1tbhltwcczoQg_QZzk,3706
4
- metacontroller_pytorch-0.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
5
- metacontroller_pytorch-0.0.1.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
6
- metacontroller_pytorch-0.0.1.dist-info/RECORD,,