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' |
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 | |
| """ | |
| 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 | |
| """ | |
| 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 | |
| """ | |
| Q-learning with value fucntion approximation | |
| """ | |
| import argparse | |
| import numpy as np | |
| import matplotlib | |
| from matplotlib import pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D |
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
| import argparse | |
| import pdb | |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| from torch.autograd import Variable | |
| import torch.nn.functional as F | |
| 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/bin/env python | |
| """ | |
| PyTorch implementation of DQN | |
| Paper: https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf | |
| """ | |
| import argparse | |
| import gym | |
| from gym import wrappers |
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
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| import torch.nn.init | |
| from torch.autograd import Variable | |
| from models.utils import * | |
| class LayerNormGRUCell(nn.GRUCell): | |
| def __init__(self, input_size, hidden_size, bias=True): |
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
| import dmc2gym | |
| import numpy as np | |
| import gym | |
| import sys | |
| seed = int(sys.argv[1]) | |
| env = dmc2gym.make( | |
| 'point_mass', | |
| 'easy', | |
| seed, |
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
| import dmc2gym | |
| import numpy as np | |
| import gym | |
| import sys | |
| seed = int(sys.argv[1]) | |
| env = dmc2gym.make( | |
| 'point_mass', | |
| 'easy', | |
| seed, |
OlderNewer