128 -> 128 -> 3 with SiLU activations and z-scored\n# I/O. Here is its forward pass. (On the page, these run the REAL published weights.)\nimport numpy as np\ndef silu(x): return x/(1+np.exp(-x))\ndef policy_forward(obs, P):\n h=(np.asarray(obs,float)-P[\"xm\"])/P[\"xs\"]\n h=silu(P[\"W0\"]@h+P[\"b0\"]); h=silu(P[\"W2\"]@h+P[\"b2\"])\n return (P[\"W4\"]@h+P[\"b4\"])*P[\"ys\"]+P[\"ym\"]\nprint(\"forward pass defined: z-score in -> 3 layers -> z-score out\")","label":"The checkpoint's forward pass"},{"code":"# A stand-in set of weights with the checkpoint's real shapes, so you can run the\n# architecture end to end. The output is a 3-D joint delta inside the +/-0.04 limit.\nrng=np.random.default_rng(0)\nP=dict(W0=rng.normal(0,0.3,(128,7)), b0=np.zeros(128),\n W2=rng.normal(0,0.1,(128,128)), b2=np.zeros(128),\n W4=rng.normal(0,0.05,(3,128)), b4=np.zeros(3),\n xm=np.zeros(7), xs=np.ones(7), ym=np.zeros(3), ys=np.full(3,0.02))\na = policy_forward(np.array([0.3,-0.2,0.6, 0.15,-0.1, 0.05,0.2]), P)\nprint(\"action:\", np.round(a,4), \" within limit:\", bool(np.abs(a).max() <= 0.04*3))","label":"Run the architecture"},{"code":"n_params = sum(v.size for k,v in P.items() if k[0] in \"Wb\")\nprint(f\"this architecture carries {n_params} parameters \"\n f\"(the real checkpoint: 17,923).\")\nassert a.shape == (3,), \"the policy must output one 3-D joint delta\"\nprint(\"PASS - you can run the released policy's forward pass.\")\nprint(\"Next: open /research/checkpoint to watch the REAL weights drive the arm.\")","label":"17,923 parameters"}],"intro":"Run the released checkpoint's exact forward-pass architecture and produce a joint-delta action.","key":"robot-learning/run-the-checkpoint","kind":"python","title":"Run the Released Checkpoint"}">
PYTHON · NUMPY · IN-BROWSER

Run the Released Checkpoint

Run the released checkpoint's exact forward-pass architecture and produce a joint-delta action.

You read

the arrays and values already in scope

You change

the code you write in each cell

Fixed

the dataset and the checks that grade you