Skip to content

Instantly share code, notes, and snippets.

View dhpollack's full-sized avatar

David Pollack dhpollack

View GitHub Profile
index mid display_name
216 /m/064t9 Pop music
217 /m/0glt670 Hip hop music
218 /m/02cz_7 Beatboxing
219 /m/06by7 Rock music
220 /m/03lty Heavy metal
221 /m/05r6t Punk rock
222 /m/0dls3 Grunge
223 /m/0dl5d Progressive rock
224 /m/07sbbz2 Rock and roll
@dhpollack
dhpollack / torch_activate.fish
Created January 3, 2018 12:09
my fish activate function for torch.
function torch_activate
set -gx TORCH_BASE_DIR '/home/david/Programming/repos/torch/torch'
set -gx LUA_PATH '{$TORCH_BASE_DIR}/install/share/lua/5.1/?.lua;{$TORCH_BASE_DIR}/install/share/lua/5.1/?/init.lua'
set -gx LUA_CPATH '{$TORCH_BASE_DIR}/install/lib/lua/5.1/?.so'
set -gx PATH {$TORCH_BASE_DIR}/install/bin $PATH
set -gx LD_LIBRARY_PATH {$TORCH_BASE_DIR}/install/lib $LD_LIBRARY_PATH
set -gx DYLD_LIBRARY_PATH {$TORCH_BASE_DIR}/install/lib $DYLD_LIBRARY_PATH
end
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.optim import lr_scheduler
import torch.utils.data as data
from torch.nn.utils.rnn import pack_padded_sequence as pack, pad_packed_sequence as unpack
import torchaudio
import torchaudio.transforms as tat
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
from torch.autograd import Variable
from tqdm import tnrange, tqdm_notebook, tqdm
"""My attempt at Karpathy's char-rnn from the unreasonableness of RNNs post
@dhpollack
dhpollack / VarLenAudioDataset_PyTorch.ipynb
Created September 15, 2017 07:53
A minimal example of a variable length dataset for pytorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhpollack
dhpollack / jekyll-install.txt
Created June 21, 2017 22:10 — forked from Piyush3dB/jekyll-install.txt
Jekyll 3.2.1, Ruby 2.2.3 install on Ubuntu 14.04
cd
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
rbenv install -v 2.2.3
rbenv global 2.2.3
ruby -v
@dhpollack
dhpollack / ContextualPolicy.ipynb
Created February 9, 2017 14:06 — forked from awjuliani/ContextualPolicy.ipynb
A Policy-Gradient algorithm that solves Contextual Bandit problems.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhpollack
dhpollack / SimplePolicy.ipynb
Last active February 9, 2017 12:23 — forked from awjuliani/SimplePolicy.ipynb
Policy gradient method for solving n-armed bandit problems.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# ftp://ftp.ncdc.noaa.gov/pub/data/cirs/climdiv/climdiv-tmpcst-v1.0.0-20160605
# ftp://ftp.ncdc.noaa.gov/pub/data/cirs/climdiv/state-readme.txt
dat = read.table("climdiv-tmpcst-v1.0.0-20160605.csv", colClasses = "character")
splitel <- function(x) {
statecode = substr(x,1,3)
divnum = substr(x,4,4)
elcode = substr(x,5,6)
year = substr(x,7,10)
return(c(statecode, divnum, elcode, year))