micahr234 commited on
Commit
1914c3e
·
verified ·
1 Parent(s): f9e7e92

Upload MOUSE model

Browse files
Files changed (3) hide show
  1. README.md +74 -0
  2. config.json +90 -0
  3. pytorch_model.bin +3 -0
README.md ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mouse-core
3
+ tags:
4
+ - mouse-core
5
+ - reinforcement-learning
6
+ ---
7
+
8
+ # micahr234/mouse-example-model
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
+
32
+ ## Install MouseCore
33
+
34
+ ```bash
35
+ pip install mouse-core
36
+ ```
37
+
38
+ ## Load The Model
39
+
40
+ ```python
41
+ import torch
42
+ from mouse_core import load_model
43
+
44
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
45
+ model = load_model("micahr234/mouse-example-model", map_location="cpu").eval().to(device)
46
+ ```
47
+
48
+ ## Run Inference
49
+
50
+ The model accepts a `list[list[dict]]` batch of shape `[B][S]` — B sequences,
51
+ each containing S step-record dicts with flat keys matching the encoder's
52
+ declared modalities above.
53
+
54
+ ```python
55
+ # Batch shape: [B=1][S=1] — one sequence of one step.
56
+ batch = [[
57
+ {
58
+ "action": 0,
59
+ "observation": 0,
60
+ "reward": 0.0,
61
+ "done": 0,
62
+ }
63
+ ]]
64
+ predictions, objective_data, cache = model(batch)
65
+
66
+ with torch.no_grad():
67
+ predictions, _, cache = model(batch)
68
+ action = model.get_action(predictions, temperature=0.0)
69
+ ```
70
+
71
+ `model()` returns `(predictions, objective_data, cache)`. `objective_data` is a
72
+ `TensorDict[B, S]` of the modality tensors extracted by the encoder — pass it
73
+ to objectives during training. For cached one-step rollout, keep `cache` and
74
+ pass it back on the next call with `use_cache=True`.
config.json ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "fourier_max": 10.0,
20
+ "fourier_min": 0.01,
21
+ "hidden_dim": 1024,
22
+ "include_type_token": false,
23
+ "modalities": [
24
+ {
25
+ "allow_none": false,
26
+ "field": "action",
27
+ "method": "rff",
28
+ "required": true,
29
+ "std": 0.02,
30
+ "tokens": 1,
31
+ "type": "discrete",
32
+ "vocab_size": 4
33
+ },
34
+ {
35
+ "allow_none": false,
36
+ "field": "observation",
37
+ "method": "rff",
38
+ "required": true,
39
+ "std": 0.02,
40
+ "tokens": 1,
41
+ "type": "discrete",
42
+ "vocab_size": 64
43
+ },
44
+ {
45
+ "allow_none": false,
46
+ "field": "reward",
47
+ "in_max": 100.0,
48
+ "in_min": 0.01,
49
+ "method": "rff",
50
+ "required": true,
51
+ "std": 0.02,
52
+ "tokens": 1,
53
+ "type": "rff"
54
+ },
55
+ {
56
+ "allow_none": false,
57
+ "field": "done",
58
+ "method": "rff",
59
+ "required": true,
60
+ "std": 0.02,
61
+ "tokens": 1,
62
+ "type": "discrete",
63
+ "vocab_size": 5
64
+ }
65
+ ],
66
+ "modality_fusion": "sum",
67
+ "std": 0.02,
68
+ "token_data_len": 1,
69
+ "type_embedding_std": 0.0
70
+ },
71
+ "type": "step"
72
+ },
73
+ "format": "mouse-core-model-v1",
74
+ "heads": {
75
+ "action_head": "action_value",
76
+ "heads": [
77
+ {
78
+ "hidden_dim": 1024,
79
+ "in_features": 1024,
80
+ "name": "action_value",
81
+ "num_layers": 1,
82
+ "out_features": 4,
83
+ "scale": 0.1,
84
+ "type": "action_value",
85
+ "use_norm": true
86
+ }
87
+ ]
88
+ },
89
+ "hidden_dim": 1024
90
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f39c53a0279e0ff0f32e1ff5d57bcfa4dffa4e147b689a12d21c9728a6fa4c0
3
+ size 1762618795