This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| """ | |
| Q-learning - off policy TD(0) learning. | |
| Q(S, A) <- Q(S, A) + alpha * ((R + gamma * max(Q(S', A'))) - Q(S, A)) | |
| A ~ e-greedy from pi(A|S) | |
| """ | |
| import argparse | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| """ | |
| SARSA - on policy TD(0) learning. | |
| Q(S, A) <- Q(S, A) + alpha * ((R + gamma * Q(S', A')) - Q(S, A)) | |
| A, A' ~ e-greedy from pi(A|S) | |
| """ | |
| import argparse | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| import argparse | |
| import numpy as np | |
| from collections import defaultdict | |
| import gym | |
| from gym import wrappers | |
| import pdb | |
| EXP_NAME_PREFIX = 'exp/on_policy_mc' |
NewerOlder