Skip to content

Commit

Permalink
Last notebook changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ansantam committed Mar 4, 2024
1 parent 0b5837a commit 2ad1f88
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 65 deletions.
Binary file added img/markov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/the_agent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 45 additions & 65 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,36 @@
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"# Importing the required packages\n",
"from time import sleep\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import names\n",
"import numpy as np\n",
"from gymnasium.wrappers import RescaleAction\n",
"from IPython.display import clear_output, display\n",
"from stable_baselines3 import PPO\n",
"\n",
"from utils.helpers import (\n",
" evaluate_ares_ea_agent,\n",
" plot_ares_ea_training_history,\n",
" show_video,\n",
")\n",
"from utils.train import ARESEACheetah, make_env, read_from_yaml\n",
"from utils.train import train as train_ares_ea\n",
"from utils.utils import NotVecNormalize"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand All @@ -159,17 +189,7 @@
}
},
"source": [
"<h2 style=\"color: #b51f2a\">Formulating the RL problem</h2>\n",
"<h3>Refresher from the lecture</h3>\n",
"\n",
"We need to define:\n",
"\n",
"- Actions\n",
"- Observations\n",
"- Reward\n",
"- Environment\n",
"- Agent\n",
" <img src=\"img/rl_problem_2.png\" style=\"width:70%; margin:auto;\"/>\n"
"<img src=\"img/the_rl_problem.png\" style=\"width:70%; margin:auto;\"/>\n"
]
},
{
Expand All @@ -181,7 +201,6 @@
},
"source": [
"<h2 style=\"color: #b51f2a\">Formulating the RL problem</h2>\n",
"<h3>Refresher from the lecture</h3>\n",
"\n",
"We need to define:\n",
"\n",
Expand All @@ -201,17 +220,7 @@
}
},
"source": [
"<h2 style=\"color: #b51f2a\">Formulating the RL problem</h2>\n",
"<h3>Refresher from the lecture</h3>\n",
"\n",
"We need to define:\n",
"\n",
"- Actions\n",
"- Observations\n",
"- Reward\n",
"- Environment\n",
"- Agent\n",
" <img src=\"img/rl_problem_2.png\" style=\"width:70%; margin:auto;\"/>\n"
"<img src=\"img/cumulate_reward.png\" style=\"width:70%; margin:auto;\"/>\n"
]
},
{
Expand All @@ -222,17 +231,18 @@
}
},
"source": [
"<h2 style=\"color: #b51f2a\">Formulating the RL problem</h2>\n",
"<h3>Refresher from the lecture</h3>\n",
"\n",
"We need to define:\n",
"\n",
"- Actions\n",
"- Observations\n",
"- Reward\n",
"- Environment\n",
"- Agent\n",
" <img src=\"img/rl_problem_2.png\" style=\"width:70%; margin:auto;\"/>\n"
"<img src=\"img/the_agent.png\" style=\"width:70%; margin:auto;\"/>\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"<img src=\"img/markov.png\" style=\"width:70%; margin:auto;\"/>\n"
]
},
{
Expand Down Expand Up @@ -284,7 +294,7 @@
"\n",
"<h3 style=\"color:#038aa1;\">Discussion</h3>\n",
"<p style=\"color:#038aa1;\"> $\\implies$ Is the action space continuous or discrete? </p>\n",
"<p style=\"color:#038aa1;\"> $\\implies$ Is the problem deterministic or stochastic?</p>\n"
"<p style=\"color:#038aa1;\"> $\\implies$ Is the problem fully observable or partially observable?</p>\n"
]
},
{
Expand Down Expand Up @@ -578,36 +588,6 @@
"You can find more information in the [paper](https://arxiv.org/abs/2401.05815) and the [code repository](https://github.com/desy-ml/cheetah).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [],
"source": [
"# Importing the required packages\n",
"from time import sleep\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import names\n",
"import numpy as np\n",
"from gymnasium.wrappers import RescaleAction\n",
"from IPython.display import clear_output, display\n",
"from stable_baselines3 import PPO\n",
"\n",
"from utils.helpers import (\n",
" evaluate_ares_ea_agent,\n",
" plot_ares_ea_training_history,\n",
" show_video,\n",
")\n",
"from utils.train import ARESEACheetah, make_env, read_from_yaml\n",
"from utils.train import train as train_ares_ea\n",
"from utils.utils import NotVecNormalize"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down

0 comments on commit 2ad1f88

Please sign in to comment.