metacontroller-pytorch 0.0.41__py3-none-any.whl → 0.0.42__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.
Potentially problematic release.
This version of metacontroller-pytorch might be problematic. Click here for more details.
- metacontroller/metacontroller.py +18 -0
- {metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/METADATA +2 -2
- {metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/RECORD +5 -5
- {metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/WHEEL +0 -0
- {metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/licenses/LICENSE +0 -0
metacontroller/metacontroller.py
CHANGED
|
@@ -66,6 +66,13 @@ MetaControllerOutput = namedtuple('MetaControllerOutput', (
|
|
|
66
66
|
'switch_loss'
|
|
67
67
|
))
|
|
68
68
|
|
|
69
|
+
GRPOOutput = namedtuple('GRPOOutput', (
|
|
70
|
+
'state',
|
|
71
|
+
'action',
|
|
72
|
+
'log_prob',
|
|
73
|
+
'switch_beta'
|
|
74
|
+
))
|
|
75
|
+
|
|
69
76
|
def z_score(t, eps = 1e-8):
|
|
70
77
|
return (t - t.mean()) / (t.std() + eps)
|
|
71
78
|
|
|
@@ -107,6 +114,17 @@ def policy_loss(
|
|
|
107
114
|
|
|
108
115
|
return masked_mean(losses, mask)
|
|
109
116
|
|
|
117
|
+
def extract_grpo_data(meta_controller, transformer_output):
|
|
118
|
+
meta_output = transformer_output.prev_hiddens.meta_controller
|
|
119
|
+
|
|
120
|
+
state = meta_output.input_residual_stream
|
|
121
|
+
action = meta_output.actions
|
|
122
|
+
switch_beta = meta_output.switch_beta
|
|
123
|
+
|
|
124
|
+
log_prob = meta_controller.log_prob(meta_output.action_dist, action)
|
|
125
|
+
|
|
126
|
+
return GRPOOutput(state, action, log_prob, switch_beta)
|
|
127
|
+
|
|
110
128
|
@save_load()
|
|
111
129
|
class MetaController(Module):
|
|
112
130
|
def __init__(
|
{metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metacontroller-pytorch
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.42
|
|
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
|
|
@@ -53,7 +53,7 @@ Description-Content-Type: text/markdown
|
|
|
53
53
|
|
|
54
54
|
<img src="./fig1.png" width="400px"></img>
|
|
55
55
|
|
|
56
|
-
## metacontroller
|
|
56
|
+
## metacontroller
|
|
57
57
|
|
|
58
58
|
Implementation of the MetaController proposed in [Emergent temporal abstractions in autoregressive models enable hierarchical reinforcement learning](https://arxiv.org/abs/2512.20605)
|
|
59
59
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
metacontroller/__init__.py,sha256=iSKbCDp3UrWhZg7SIJFYNjdVQU56u-vqZarE6qCSX74,70
|
|
2
|
-
metacontroller/metacontroller.py,sha256=
|
|
2
|
+
metacontroller/metacontroller.py,sha256=hOzMIeBwNZhrzpt6tnLahxuHJ4pPQ7JlEGBOxYHI_88,17875
|
|
3
3
|
metacontroller/metacontroller_with_binary_mapper.py,sha256=Ce5-O95_pLuWNA3aZTlKrTGbc5cemb61tBtJBdSiLx4,9843
|
|
4
4
|
metacontroller/transformer_with_resnet.py,sha256=R49ycusbq3kEX97WHZ41WY2ONc2mYPOuRUCmaFcBOEo,5546
|
|
5
|
-
metacontroller_pytorch-0.0.
|
|
6
|
-
metacontroller_pytorch-0.0.
|
|
7
|
-
metacontroller_pytorch-0.0.
|
|
8
|
-
metacontroller_pytorch-0.0.
|
|
5
|
+
metacontroller_pytorch-0.0.42.dist-info/METADATA,sha256=f9KRrtFWHgZrx5HZYBGNrtfXrcfSOeZlRFfx7VYMOd0,6816
|
|
6
|
+
metacontroller_pytorch-0.0.42.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
metacontroller_pytorch-0.0.42.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
|
|
8
|
+
metacontroller_pytorch-0.0.42.dist-info/RECORD,,
|
|
File without changes
|
{metacontroller_pytorch-0.0.41.dist-info → metacontroller_pytorch-0.0.42.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|