Skip to content

Instantly share code, notes, and snippets.

View kastnerkyle's full-sized avatar

Kyle Kastner kastnerkyle

View GitHub Profile
@kastnerkyle
kastnerkyle / .gitignore
Created March 11, 2019 20:31 — forked from ctsrc/.gitignore
Random dungeon generator from https://news.ycombinator.com/item?id=19309378, deobfuscated, refactored and commented
/.idea/
/cmake-build-debug/
/dungeon
sudo add-apt-repository ppa:graphics-drivers -y
sudo apt-get update
sudo apt-get install nvidia-driver-418 nvidia-utils-418 nvidia-settings -y
wget -N https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run
wget -N http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb
sudo ./cuda_10.1.105_418.39_linux.run --override --silent --toolkit --no-opengl-libs
sudo dpkg -i libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb
sudo apt-get install libcupti-dev -y
{
"transcript": "the Roman letter was used side by side with the Gothic.",
"words": [
{
"case": "success",
"end": 0.11,
"endOffset": 3,
"phones": [
{
"duration": 0.05,
# Author: Kyle Kastner
# License: BSD 3-Clause
import os
import copy
import numpy as np
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from scipy.io import wavfile
import scipy.signal as sg
# Author: Kyle Kastner
# License: BSD 3-Clause
# A port of the code from
# "Griffin-Lim Like Phase Recovery via Alternating Direction Method of Multipliers", Yoshiki Masuyama, Kohei Yatabe, Yasuhiro Oikawa
# https://ieeexplore.ieee.org/document/8552369
# https://codeocean.com/capsule/1284665/tree/v1
# into numpy
import numpy as np
import scipy.signal as sg
import scipy
@kastnerkyle
kastnerkyle / install_voices.sh
Created February 23, 2019 03:28
Install festival and festival voices in Ubuntu
# https://ubuntuforums.org/archive/index.php/t-751169.html
sudo apt-get install -y festival festlex-cmu festlex-poslex festlex-oald libestools1.2 unzip
sudo apt-get install -y festvox-don festvox-rablpc16k festvox-kallpc16k festvox-kdlpc16k
mkdir cmu_tmp
pushd .
cd cmu_tmp/
wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_awb_arctic-0.90-release.tar.bz2
wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_bdl_arctic-0.95-release.tar.bz2
@kastnerkyle
kastnerkyle / vector_kuhn.py
Last active April 21, 2022 01:07
Vectorized, alternating update versions of various algorithms for Kuhn poker
# Author: Kyle Kastner
# License: BSD 3-Clause
# Vectorized, alternating update CFR+ for Kuhn poker
# For specific algorithmic details see
# http://jeskola.net/cfrp_mt.pdf
# https://pdfs.semanticscholar.org/ed52/8594465e96f51fd9a3cf00401bfba20597fa.pdf
# An alternate overview using scalar, simultaneous updates
# https://justinsermeno.com/posts/cfr/
# Author: Kyle Kastner
# License: BSD 3-Clause
# Inspired from blogpost by Justin Sermeno https://justinsermeno.com/posts/cfr/
# Extended with algorithms described by Oskari Tammelin http://jeskola.net/cfr/demo/ by
# Particularly, solve has core game logic
# http://jeskola.net/cfr/demo/solve.js
# basecfr: http://poker.cs.ualberta.ca/publications/NIPS07-cfr.pdf
# cfrplus: https://arxiv.org/abs/1407.5042
@kastnerkyle
kastnerkyle / cfr_kuhn.py
Last active September 18, 2019 07:25
CFR and follow-on improvements in Python
# Author: Kyle Kastner
# License: BSD 3-Clause
# Drectly lifted from the great blogpost by Justin Sermeno https://justinsermeno.com/posts/cfr/
# References:
# https://int8.io/counterfactual-regret-minimization-for-poker-ai/
# http://cs.gettysburg.edu/~tneller/modelai/2013/cfr/cfr.pdf
# https://github.com/Limegrass/Counterfactual-Regret-Minimization/blob/notes/Learning_to_Play_Poker_using_CounterFactual_Regret_Minimization.pdf
# http://poker.cs.ualberta.ca/publications/Burch_Neil_E_201712_PhD.pdf
# http://mlanctot.info/files/papers/PhD_Thesis_MarcLanctot.pdf
@kastnerkyle
kastnerkyle / dqn_fruit.py
Last active March 5, 2019 05:25
Implementation of DQN, Double DQN, Bootstrap DQN, and Bootstrap DQN with Randomized Prior in PyTorch on a toy environment
# extending on code from
# https://github.com/58402140/Fruit
import os
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import copy
import time
from collections import Counter