Skip to content

Instantly share code, notes, and snippets.

Ryan Brigden rbrigden

Block or report user

Report or block rbrigden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rbrigden
rbrigden / wsj_loader.py
Last active May 7, 2019
Load the WSJ speech dataset
View wsj_loader.py
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:
@rbrigden
rbrigden / solar_system.py
Created Sep 17, 2015
planet orbit simulation project for 33-151 in vpython
View solar_system.py
# 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 *
View multi_softmax.py
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
@rbrigden
rbrigden / weight_ops.py
Created Jun 20, 2018
Apply torch functions to weight parameters
View weight_ops.py
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))
@rbrigden
rbrigden / quiz13.py
Last active Apr 25, 2018
Template for solving question 4 for of quiz 13
View quiz13.py
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
@rbrigden
rbrigden / setup_vim_ubuntu.sh
Created Dec 20, 2017
setup vim on ubuntu with my configs
View setup_vim_ubuntu.sh
#!/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
View ten_armed_bandit.py
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)
View autoencoder.py
from __future__ import division, print_function, absolute_import
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data", one_hot=False)
View searchable_startupy_domains.csv
abdominocardiac abdominocardi.ac
autotractor autotr.actor
cephalotractor cephalotr.actor
cocontractor cocontr.actor
coenactor coen.actor
cornfactor cornf.actor
counteractor counter.actor
effractor effr.actor
idemfactor idemf.actor
lithofractor lithofr.actor
@rbrigden
rbrigden / startupy_domains.txt
Last active May 29, 2017
Every english word that is currently available for registration as a full domain (TLD included).
View startupy_domains.txt
abdominocardi.ac
autotr.actor
cephalotr.actor
cocontr.actor
coen.actor
cornf.actor
counter.actor
effr.actor
idemf.actor
lithofr.actor
You can’t perform that action at this time.