micahr234 commited on
Commit
1dcd098
·
verified ·
1 Parent(s): 14588bf

Upload MOUSE model

Browse files
Files changed (3) hide show
  1. README.md +77 -0
  2. config.json +98 -0
  3. pytorch_model.bin +3 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mouse-core
3
+ tags:
4
+ - mouse-core
5
+ - reinforcement-learning
6
+ ---
7
+
8
+ <!-- uploaded: 2026-06-26T03:54:15Z -->
9
+
10
+ # micahr234/mouse-example-model-augmented2
11
+
12
+ This repository contains a MOUSE model checkpoint.
13
+
14
+ ## Architecture
15
+
16
+ - Backbone: `qwen3`
17
+ - Hidden dimension: `1024`
18
+ - Heads: `action_value`
19
+ - Action head: `action_value`
20
+
21
+ ### Encoder
22
+
23
+ `StepEmbedder` reads flat step-record dicts and projects each declared modality
24
+ into the shared `1024`-dimensional token space before the
25
+ backbone.
26
+
27
+ | Field | Type | Required | Tensor shape | Dtype | Notes |
28
+ |---|---|---:|---|---|---|
29
+ | `action` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 3]` |
30
+ | `observation` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 63]` |
31
+ | `reward` | `rff` | yes | `[B, S]` | `torch.float32` | scalar value |
32
+ | `done` | `discrete` | yes | `[B, S]` | `torch.long` | integer ids in `[0, 4]` |
33
+ | - | `learnable` | no | `not read from step_stream` | `n/a` | learned tokens; no input field |
34
+
35
+ ## Install MouseCore
36
+
37
+ ```bash
38
+ pip install mouse-core
39
+ ```
40
+
41
+ ## Load The Model
42
+
43
+ ```python
44
+ import torch
45
+ from mouse_core import load_model
46
+
47
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
48
+ model = load_model("micahr234/mouse-example-model-augmented2", map_location="cpu").eval().to(device)
49
+ ```
50
+
51
+ ## Run Inference
52
+
53
+ The model accepts a `list[list[dict]]` batch of shape `[B][S]` — B sequences,
54
+ each containing S step-record dicts with flat keys matching the encoder's
55
+ declared modalities above.
56
+
57
+ ```python
58
+ # Batch shape: [B=1][S=1] — one sequence of one step.
59
+ batch = [[
60
+ {
61
+ "action": 0,
62
+ "observation": 0,
63
+ "reward": 0.0,
64
+ "done": 0,
65
+ }
66
+ ]]
67
+ predictions, objective_data, cache = model(batch)
68
+
69
+ with torch.no_grad():
70
+ predictions, _, cache = model(batch)
71
+ action = model.get_action(predictions, temperature=0.0)
72
+ ```
73
+
74
+ `model()` returns `(predictions, objective_data, cache)`. `objective_data` is a
75
+ `TensorDict[B, S]` of the modality tensors extracted by the encoder — pass it
76
+ to objectives during training. For cached one-step rollout, keep `cache` and
77
+ pass it back on the next call with `use_cache=True`.
config.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb45ed510a057eb36954c6cc2f8e24c28ff3430d4865650ded55352f59fcf324
3
+ size 1762623279