This file contains 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 matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import random | |
class TenArmedBandit(object): | |
def __init__(self): | |
self.action_space = 10 | |
self.q_true = np.random.randn(self.action_space) |
This file contains 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
#!/bin/bash | |
cd ~ | |
apt-get install git | |
# setup dotfiles | |
rm -rf .vim* | |
git clone https://github.com/rbrigden/dotfiles.git .dotfiles | |
ln -s .dotfiles/.vimrc .vimrc |
This file contains 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 numpy as np | |
import copy | |
# NOTE: a = 1 is a(-), a = 0 is a(+) | |
gamma = 0.9 | |
action_space = 2 | |
state_space = 4 | |
eps = 1e-9 | |
# Action conditioned reward function |
This file contains 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 | |
import torch.nn as nn | |
from torch.autograd import Variable | |
affine = nn.Linear(10, 10) | |
# A linear mapping to a random vector... just for quick demo purposes | |
x = Variable(torch.randn(100, 10)) | |
y = Variable(torch.randn(100, 10)) | |
weird_loss = torch.mean(torch.exp(affine.weight)) |
This file contains 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 | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import numpy as np | |
class MLP(nn.Module): | |
def __init__(self, input_size, feature_categories): | |
super(MLP, self).__init__() | |
self.feature_categories = feature_categories |
This file contains 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
# simulate the solar system | |
# Author: Ryan Brigden | |
# 33-151: M&I I | |
# planet and orbital data from: | |
# http://nssdc.gsfc.nasa.gov/planetary/factsheet/planet_table_ratio.html | |
# http://education.nationalgeographic.com/activity/planetary-size-and-distance-comparison/ | |
# http://www.sjsu.edu/faculty/watkins/orbital.htm | |
from visual import * |
This file contains 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 numpy as np | |
import os | |
class WSJ(): | |
""" Load the WSJ speech dataset | |
Ensure WSJ_PATH is path to directory containing | |
all data files (.npy) provided on Kaggle. | |
Example usage: |
OlderNewer