Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda to Gamma. Updated Readme. #121

Merged
merged 1 commit into from
Nov 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MC/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

### Exercises

- [Get familiar with the Blackjack environment (Blackjack-v0)](Blackjack%20Playground.ipynb)
- Get familiar with the [Blackjack environment (Blackjack-v0)](Blackjack%20Playground.ipynb)
- Implement the Monte Carlo Prediction to estimate state-action values
- [Exercise](MC%20Prediction.ipynb)
- [Solution](MC%20Prediction%20Solution.ipynb)
Expand Down
26 changes: 8 additions & 18 deletions TD/Q-Learning Solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand All @@ -31,9 +29,7 @@
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"env = CliffWalkingEnv()"
Expand Down Expand Up @@ -73,9 +69,7 @@
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"def q_learning(env, num_episodes, discount_factor=1.0, alpha=0.5, epsilon=0.1):\n",
Expand All @@ -86,7 +80,7 @@
" Args:\n",
" env: OpenAI environment.\n",
" num_episodes: Number of episodes to run for.\n",
" discount_factor: Lambda time discount factor.\n",
" discount_factor: Gamma discount factor.\n",
" alpha: TD learning rate.\n",
" epsilon: Chance the sample a random action. Float betwen 0 and 1.\n",
" \n",
Expand Down Expand Up @@ -147,9 +141,7 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -166,9 +158,7 @@
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -231,9 +221,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
26 changes: 8 additions & 18 deletions TD/Q-Learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand All @@ -30,9 +28,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"env = CliffWalkingEnv()"
Expand Down Expand Up @@ -72,9 +68,7 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"def q_learning(env, num_episodes, discount_factor=1.0, alpha=0.5, epsilon=0.1):\n",
Expand All @@ -85,7 +79,7 @@
" Args:\n",
" env: OpenAI environment.\n",
" num_episodes: Number of episodes to run for.\n",
" discount_factor: Lambda time discount factor.\n",
" discount_factor: Gamma discount factor.\n",
" alpha: TD learning rate.\n",
" epsilon: Chance the sample a random action. Float betwen 0 and 1.\n",
" \n",
Expand Down Expand Up @@ -121,9 +115,7 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -140,9 +132,7 @@
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -205,9 +195,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
4 changes: 2 additions & 2 deletions TD/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@

### Exercises

- [Windy Gridworld Playground](Windy%20Gridworld%20Playground.ipynb)
- Get familiar with the [Windy Gridworld Playground](Windy%20Gridworld%20Playground.ipynb)
- Implement SARSA
- [Exercise](SARSA.ipynb)
- [Solution](SARSA%20Solution.ipynb)
- [Cliff Environment Playground](Cliff%20Environment%20Playground.ipynb)
- Get familiar with the [Cliff Environment Playground](Cliff%20Environment%20Playground.ipynb)
- Implement Q-Learning in Python
- [Exercise](Q-Learning.ipynb)
- [Solution](Q-Learning%20Solution.ipynb)
30 changes: 9 additions & 21 deletions TD/SARSA Solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down Expand Up @@ -39,9 +37,7 @@
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"env = WindyGridworldEnv()"
Expand Down Expand Up @@ -81,9 +77,7 @@
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"def sarsa(env, num_episodes, discount_factor=1.0, alpha=0.5, epsilon=0.1):\n",
Expand All @@ -93,7 +87,7 @@
" Args:\n",
" env: OpenAI environment.\n",
" num_episodes: Number of episodes to run for.\n",
" discount_factor: Lambda time discount factor.\n",
" discount_factor: Gamma discount factor.\n",
" alpha: TD learning rate.\n",
" epsilon: Chance the sample a random action. Float betwen 0 and 1.\n",
" \n",
Expand Down Expand Up @@ -156,9 +150,7 @@
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -175,9 +167,7 @@
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -217,9 +207,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": []
}
Expand All @@ -240,9 +228,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
30 changes: 9 additions & 21 deletions TD/SARSA.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand All @@ -30,9 +28,7 @@
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"env = WindyGridworldEnv()"
Expand Down Expand Up @@ -72,9 +68,7 @@
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"def sarsa(env, num_episodes, discount_factor=1.0, alpha=0.5, epsilon=0.1):\n",
Expand All @@ -84,7 +78,7 @@
" Args:\n",
" env: OpenAI environment.\n",
" num_episodes: Number of episodes to run for.\n",
" discount_factor: Lambda time discount factor.\n",
" discount_factor: Gamma discount factor.\n",
" alpha: TD learning rate.\n",
" epsilon: Chance the sample a random action. Float betwen 0 and 1.\n",
" \n",
Expand Down Expand Up @@ -121,9 +115,7 @@
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -140,9 +132,7 @@
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -182,9 +172,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": []
}
Expand All @@ -205,9 +193,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}