metacontroller-pytorch 0.0.2__py3-none-any.whl → 0.0.3__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.
@@ -215,6 +215,8 @@ class Transformer(Module):
215
215
 
216
216
  self.meta_controller = meta_controller
217
217
 
218
+ self.register_buffer('zero', tensor(0.), persistent = False)
219
+
218
220
  def evolve(
219
221
  self,
220
222
  environment,
@@ -238,7 +240,7 @@ class Transformer(Module):
238
240
  discovery_phase = False,
239
241
  return_latents = False
240
242
  ):
241
- meta_controller = default(meta_controller, self.meta_controller, Identity())
243
+ meta_controller = default(meta_controller, self.meta_controller)
242
244
 
243
245
  embed = self.embed(ids)
244
246
 
@@ -246,7 +248,10 @@ class Transformer(Module):
246
248
 
247
249
  # meta controller acts on residual stream here
248
250
 
249
- modified_residual_stream, vae_aux_loss = meta_controller(residual_stream, discovery_phase = discovery_phase)
251
+ if exists(meta_controller):
252
+ modified_residual_stream, vae_aux_loss = meta_controller(residual_stream, discovery_phase = discovery_phase)
253
+ else:
254
+ modified_residual_stream, vae_aux_loss = residual_stream, self.zero
250
255
 
251
256
  # modified residual stream sent back
252
257
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacontroller-pytorch
3
- Version: 0.0.2
3
+ Version: 0.0.3
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=JZHAkyYbonP5aj_Ob-Xe41ziLEoJLL0KjJy3Dm_bXGY,8091
3
+ metacontroller_pytorch-0.0.3.dist-info/METADATA,sha256=XO3zKqbfSpGmYe34P0uXetIygqkfD1QLuKSSClEeZhk,3706
4
+ metacontroller_pytorch-0.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
5
+ metacontroller_pytorch-0.0.3.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
6
+ metacontroller_pytorch-0.0.3.dist-info/RECORD,,
@@ -1,6 +0,0 @@
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,,