Skip to content

Commit

Permalink
Fix typo in locomotion notebook.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 716261752
Change-Id: I7b0774d8dfcfcae260881d5864753881f1e630b1
  • Loading branch information
kevinzakka authored and copybara-github committed Jan 16, 2025
1 parent 724ed64 commit a0ffd17
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions learning/notebooks/locomotion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"id": "_UbO9uhtBSX5"
},
"source": [
"> <p><small><small>Copyright 2025 DeepMind Technologies Limited.</small></p>\n",
"> <p><small><small>Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">http://www.apache.org/licenses/LICENSE-2.0</a>.</small></small></p>\n",
"> <p><small><small>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</small></small></p>"
"\u003e \u003cp\u003e\u003csmall\u003e\u003csmall\u003eCopyright 2025 DeepMind Technologies Limited.\u003c/small\u003e\u003c/p\u003e\n",
"\u003e \u003cp\u003e\u003csmall\u003e\u003csmall\u003eLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at \u003ca href=\"http://www.apache.org/licenses/LICENSE-2.0\"\u003ehttp://www.apache.org/licenses/LICENSE-2.0\u003c/a\u003e.\u003c/small\u003e\u003c/small\u003e\u003c/p\u003e\n",
"\u003e \u003cp\u003e\u003csmall\u003e\u003csmall\u003eUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\u003c/small\u003e\u003c/small\u003e\u003c/p\u003e"
]
},
{
Expand All @@ -40,11 +40,11 @@
"id": "dNIJkb_FM2Ux"
},
"source": [
"# Locomotion in The Playground! <a href=\"https://colab.research.google.com/github/google-deepmind/mujoco_playground/blob/main/learning/notebooks/locomotion.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" width=\"140\" align=\"center\"/></a>\n",
"# Locomotion in The Playground! \u003ca href=\"https://colab.research.google.com/github/google-deepmind/mujoco_playground/blob/main/learning/notebooks/locomotion.ipynb\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" width=\"140\" align=\"center\"/\u003e\u003c/a\u003e\n",
"\n",
"In this notebook, we'll walk through a few locomotion environments available in MuJoCo Playground.\n",
"\n",
"**A Colab runtime with GPU acceleration is required.** If you're using a CPU-only runtime, you can switch using the menu \"Runtime > Change runtime type\".\n"
"**A Colab runtime with GPU acceleration is required.** If you're using a CPU-only runtime, you can switch using the menu \"Runtime \u003e Change runtime type\".\n"
]
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
" print('Checking that the installation succeeded:')\n",
" import mujoco\n",
"\n",
" mujoco.MjModel.from_xml_string('<mujoco/>')\n",
" mujoco.MjModel.from_xml_string('\u003cmujoco/\u003e')\n",
"except Exception as e:\n",
" raise e from RuntimeError(\n",
" 'Something went wrong during installation. Check the shell output above '\n",
Expand Down Expand Up @@ -142,7 +142,7 @@
"\n",
"# Graphics and plotting.\n",
"print(\"Installing mediapy:\")\n",
"!command -v ffmpeg >/dev/null || (apt update && apt install -y ffmpeg)\n",
"!command -v ffmpeg \u003e/dev/null || (apt update \u0026\u0026 apt install -y ffmpeg)\n",
"!pip install -q mediapy\n",
"import mediapy as media\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -476,11 +476,11 @@
"command = jp.array([x_vel, y_vel, yaw_vel])\n",
"\n",
"state = jit_reset(rng)\n",
"if state.info[\"steps_since_last_pert\"] < state.info[\"steps_until_next_pert\"]:\n",
"if state.info[\"steps_since_last_pert\"] \u003c state.info[\"steps_until_next_pert\"]:\n",
" rng = sample_pert(rng)\n",
"state.info[\"command\"] = command\n",
"for i in range(env_cfg.episode_length):\n",
" if state.info[\"steps_since_last_pert\"] < state.info[\"steps_until_next_pert\"]:\n",
" if state.info[\"steps_since_last_pert\"] \u003c state.info[\"steps_until_next_pert\"]:\n",
" rng = sample_pert(rng)\n",
" act_rng, rng = jax.random.split(rng)\n",
" ctrl, _ = jit_inference_fn(state.obs, act_rng)\n",
Expand Down Expand Up @@ -645,13 +645,13 @@
"command = jp.array([x, 0, 0])\n",
"state = jit_reset(rng)\n",
"for i in range(1_400):\n",
" # Increase the forward velocity by 0.2 m/s every 200 steps.\n",
" # Increase the forward velocity by 0.25 m/s every 200 steps.\n",
" if i % 200 == 0:\n",
" x += 0.25\n",
" print(f\"Setting x to {x}\")\n",
" command = jp.array([x, 0, 0])\n",
" state.info[\"command\"] = command\n",
" if state.info[\"steps_since_last_pert\"] < state.info[\"steps_until_next_pert\"]:\n",
" if state.info[\"steps_since_last_pert\"] \u003c state.info[\"steps_until_next_pert\"]:\n",
" rng = sample_pert(rng)\n",
" act_rng, rng = jax.random.split(rng)\n",
" ctrl, _ = jit_inference_fn(state.obs, act_rng)\n",
Expand Down

0 comments on commit a0ffd17

Please sign in to comment.