micahr234 commited on
Commit
853b6e4
·
verified ·
1 Parent(s): 39287fd

Clear repository before upload

Browse files
Files changed (3) hide show
  1. README.md +0 -75
  2. config.json +0 -98
  3. pytorch_model.bin +0 -3
README.md DELETED
@@ -1,75 +0,0 @@
1
- ---
2
- library_name: mouse-core
3
- tags:
4
- - mouse-core
5
- - reinforcement-learning
6
- ---
7
-
8
- # micahr234/mouse-example-model-augmented
9
-
10
- This repository contains a MOUSE model checkpoint.
11
-
12
- ## Architecture
13
-
14
- - Backbone: `qwen3`
15
- - Hidden dimension: `1024`
16
- - Heads: `action_value`
17
- - Action head: `action_value`
18
-
19
- ### Encoder
20
-
21
- `StepEmbedder` reads flat step-record dicts and projects each declared modality
22
- into the shared `1024`-dimensional token space before the
23
- backbone.
24
-
25
- | Field | Type | Required | Tensor shape | Dtype | Notes |
26
- |---|---|---:|---|---|---|
27
- | `action` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 3]` |
28
- | `observation` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 63]` |
29
- | `reward` | `rff` | yes | `[B, S]` | `torch.float32` | scalar value |
30
- | `done` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 4]` |
31
- | - | `learnable` | no | `not read from step_stream` | `n/a` | learned tokens; no input field |
32
-
33
- ## Install MouseCore
34
-
35
- ```bash
36
- pip install mouse-core
37
- ```
38
-
39
- ## Load The Model
40
-
41
- ```python
42
- import torch
43
- from mouse_core import load_model
44
-
45
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
46
- model = load_model("micahr234/mouse-example-model-augmented", map_location="cpu").eval().to(device)
47
- ```
48
-
49
- ## Run Inference
50
-
51
- The model accepts a `list[list[dict]]` batch of shape `[B][S]` — B sequences,
52
- each containing S step-record dicts with flat keys matching the encoder's
53
- declared modalities above.
54
-
55
- ```python
56
- # Batch shape: [B=1][S=1] — one sequence of one step.
57
- batch = [[
58
- {
59
- "action": 0,
60
- "observation": 0,
61
- "reward": 0.0,
62
- "done": 0,
63
- }
64
- ]]
65
- predictions, objective_data, cache = model(batch)
66
-
67
- with torch.no_grad():
68
- predictions, _, cache = model(batch)
69
- action = model.get_action(predictions, temperature=0.0)
70
- ```
71
-
72
- `model()` returns `(predictions, objective_data, cache)`. `objective_data` is a
73
- `TensorDict[B, S]` of the modality tensors extracted by the encoder — pass it
74
- to objectives during training. For cached one-step rollout, keep `cache` and
75
- pass it back on the next call with `use_cache=True`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config.json DELETED
@@ -1,98 +0,0 @@
1
- {
2
- "backbone": {
3
- "hidden_dim": 1024,
4
- "kwargs": {
5
- "attention_bias": false,
6
- "head_dim": 128,
7
- "intermediate_size": 3072,
8
- "max_position_embeddings": 40960,
9
- "num_heads": 16,
10
- "num_key_value_heads": 8,
11
- "num_layers": 28,
12
- "rms_norm_eps": 1e-06,
13
- "use_sliding_window": false
14
- },
15
- "type": "qwen3"
16
- },
17
- "encoder": {
18
- "kwargs": {
19
- "concat_modalities": false,
20
- "fourier_max": 10.0,
21
- "fourier_min": 0.01,
22
- "hidden_dim": 1024,
23
- "include_type_token": false,
24
- "modalities": [
25
- {
26
- "allow_none": false,
27
- "field": "action",
28
- "method": "rff",
29
- "required": true,
30
- "std": 0.02,
31
- "tokens": 1,
32
- "type": "discrete",
33
- "vocab_size": 4
34
- },
35
- {
36
- "allow_none": false,
37
- "field": "observation",
38
- "method": "rff",
39
- "required": true,
40
- "std": 0.02,
41
- "tokens": 1,
42
- "type": "discrete",
43
- "vocab_size": 64
44
- },
45
- {
46
- "allow_none": false,
47
- "field": "reward",
48
- "in_max": 100.0,
49
- "in_min": 0.01,
50
- "method": "rff",
51
- "required": true,
52
- "std": 0.02,
53
- "tokens": 1,
54
- "type": "rff"
55
- },
56
- {
57
- "allow_none": false,
58
- "field": "done",
59
- "method": "rff",
60
- "required": true,
61
- "std": 0.02,
62
- "tokens": 1,
63
- "type": "discrete",
64
- "vocab_size": 5
65
- },
66
- {
67
- "allow_none": false,
68
- "method": "rff",
69
- "required": false,
70
- "std": 0.02,
71
- "tokens": 1,
72
- "type": "learnable"
73
- }
74
- ],
75
- "std": 0.02,
76
- "token_data_len": 1,
77
- "type_embedding_std": 0.0
78
- },
79
- "type": "step"
80
- },
81
- "format": "mouse-core-model-v1",
82
- "heads": {
83
- "action_head": "action_value",
84
- "heads": [
85
- {
86
- "hidden_dim": 1024,
87
- "in_features": 1024,
88
- "name": "action_value",
89
- "num_layers": 1,
90
- "out_features": 4,
91
- "scale": 0.1,
92
- "type": "action_value",
93
- "use_norm": true
94
- }
95
- ]
96
- },
97
- "hidden_dim": 1024
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pytorch_model.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:553fd62176e3140b7211639ff8d593086de2afff7e6cca42ff046a358935ab07
3
- size 1762623279