{ "schema": "wrsi.model_spec.film_policy.v1", "model_id": "mdb8464d0", "arch": "film_policy", "kind": "policy", "input": { "kind": "observation rows", "dtype": "int64", "shape": [ 197 ], "layout": "int64 [197]: the grid [x, y, channel] in C order (192 values), then 5 word ids", "grid": { "width": 8, "height": 8, "cell": "(object index, color index, state)", "order": "x (column, 0 = west) outer, y (row, 0 = north) middle, channel inner", "objects": [ { "index": 0, "name": "unseen" }, { "index": 1, "name": "empty" }, { "index": 2, "name": "wall" }, { "index": 3, "name": "floor" }, { "index": 4, "name": "door" }, { "index": 5, "name": "key" }, { "index": 6, "name": "ball" }, { "index": 7, "name": "box" }, { "index": 8, "name": "goal" }, { "index": 9, "name": "lava" }, { "index": 10, "name": "agent" } ], "colors": [ { "index": 0, "name": "red" }, { "index": 1, "name": "green" }, { "index": 2, "name": "blue" }, { "index": 3, "name": "purple" }, { "index": 4, "name": "yellow" }, { "index": 5, "name": "grey" } ], "state": "door: 0 open, 1 closed, 2 locked; on the agent's cell its facing direction: 0 east (+x), 1 south (+y), 2 west (-x), 3 north (-y); 0 on every other cell", "agent": "exactly one cell has object index 10 (agent); its color index is 0 and its state the direction. The cell in front of the agent is (x, y) + (1, 0), (0, 1), (-1, 0) or (0, -1) for direction 0, 1, 2, 3", "walls": "the outer ring of cells is wall; the room's interior is 6 x 6", "carrying": "not encoded" }, "instruction": { "length": 5, "layout": "[verb, verb, article, color, type] as word ids", "words": [ { "id": 0, "word": "go", "meaning": "verb of the trained mission (\"go to\")" }, { "id": 1, "word": "to", "meaning": "verb of the trained mission (\"go to\")" }, { "id": 2, "word": "pick", "meaning": "reserved word; absent from all training rows (its embedding row is untrained)" }, { "id": 3, "word": "up", "meaning": "reserved word; absent from all training rows (its embedding row is untrained)" }, { "id": 4, "word": "the", "meaning": "article: \"the\" when exactly one object in the room matches the named color and type, \"a\" when several do" }, { "id": 5, "word": "a", "meaning": "article: \"the\" when exactly one object in the room matches the named color and type, \"a\" when several do" }, { "id": 6, "word": "red", "meaning": "color red (color index 0 in the grid)" }, { "id": 7, "word": "green", "meaning": "color green (color index 1 in the grid)" }, { "id": 8, "word": "blue", "meaning": "color blue (color index 2 in the grid)" }, { "id": 9, "word": "purple", "meaning": "color purple (color index 3 in the grid)" }, { "id": 10, "word": "yellow", "meaning": "color yellow (color index 4 in the grid)" }, { "id": 11, "word": "grey", "meaning": "color grey (color index 5 in the grid)" }, { "id": 12, "word": "ball", "meaning": "object type ball (object index 6 in the grid)" }, { "id": 13, "word": "box", "meaning": "object type box (object index 7 in the grid)" }, { "id": 14, "word": "key", "meaning": "object type key (object index 5 in the grid)" } ] } }, "actions": [ { "index": 0, "name": "left", "meaning": "turn left (direction - 1 mod 4)" }, { "index": 1, "name": "right", "meaning": "turn right (direction + 1 mod 4)" }, { "index": 2, "name": "forward", "meaning": "move one cell in the facing direction if that cell is empty" }, { "index": 3, "name": "pickup", "meaning": "pick up the object in the facing cell if not carrying one" }, { "index": 4, "name": "drop", "meaning": "drop the carried object in the facing cell if it is empty" }, { "index": 5, "name": "toggle", "meaning": "toggle (open or close) the object in the facing cell" }, { "index": 6, "name": "done", "meaning": "no effect in these missions" } ], "trained_mission": { "grammar": "go to {the|a} {color} {type}, color in red green blue purple yellow grey, type in ball box key", "room": "one 8 x 8 grid (6 x 6 interior) with 9 objects (balls, boxes, keys) and the agent; no doors", "success": "the episode succeeds when the agent faces (is next to and looking at) an object of the named color and type; it fails after 64 steps", "training": "imitation of a planner's actions on the trained mission only; the training actions are left, right and forward" }, "parameter_layout": "PyTorch: embedding [rows, dim]; linear weight [out, in] and bias [out]; conv weight [out, in, 3, 3] and bias [out]; LayerNorm weight and bias [d_hidden]; all float32", "sizes": { "d_cell": 16, "d_word": 32, "d_instr": 128, "channels": 64, "d_hidden": 256 }, "n_parameters": 1151799, "tensors": { "obj_emb.weight": [ 11, 16 ], "col_emb.weight": [ 6, 16 ], "state_emb.weight": [ 4, 16 ], "word_emb.weight": [ 15, 32 ], "instr.weight": [ 128, 160 ], "instr.bias": [ 128 ], "conv1.weight": [ 64, 16, 3, 3 ], "conv1.bias": [ 64 ], "film1.weight": [ 128, 128 ], "film1.bias": [ 128 ], "conv2.weight": [ 64, 64, 3, 3 ], "conv2.bias": [ 64 ], "film2.weight": [ 128, 128 ], "film2.bias": [ 128 ], "fc.weight": [ 256, 4096 ], "fc.bias": [ 256 ], "ln.weight": [ 256 ], "ln.bias": [ 256 ], "head.weight": [ 7, 256 ], "head.bias": [ 7 ] }, "layers": [ { "name": "cells", "computes": "e[n, x, y] = obj_emb.weight[object] + col_emb.weight[color] + state_emb.weight[state]", "shape": [ 16, 8, 8 ] }, { "name": "instr", "computes": "w = concat(word_emb.weight[id_0], ..., word_emb.weight[id_4]); h = relu(instr.weight @ w + instr.bias)", "shape": [ 128 ] }, { "name": "block1", "computes": "z = conv1(e); (g, b) = split(film1.weight @ h + film1.bias); z = relu(z * (1 + g) + b), g and b per channel", "shape": [ 64, 8, 8 ] }, { "name": "block2", "computes": "z = conv2(z); (g, b) = split(film2.weight @ h + film2.bias); z = relu(z * (1 + g) + b)", "shape": [ 64, 8, 8 ] }, { "name": "fc", "computes": "u = relu(ln(fc.weight @ flatten(z) + fc.bias)), flatten in (channel, x, y) C order, ln = LayerNorm with eps 1e-5", "shape": [ 256 ] }, { "name": "head", "computes": "logits = head.weight @ u + head.bias", "shape": [ 7 ] } ], "conv": "3x3 cross-correlation as torch.nn.functional.conv2d, stride 1, zero padding 1, with bias", "output": "action logits [N, 7]; the action taken is the argmax (greedy, first index on ties)", "reference_forward": "forward.py: forward(params, x_int64 [N, 197]) -> float32 logits [N, 7]" }