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
raise ValueError("DEPRECATED/FROZEN - see https://github.com/kastnerkyle/tools for the latest") | |
# License: BSD 3-clause | |
# Authors: Kyle Kastner | |
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise | |
# http://ml.cs.yamanashi.ac.jp/world/english/ | |
# MGC code based on r9y9 (Ryuichi Yamamoto) MelGeneralizedCepstrums.jl | |
# Pieces also adapted from SPTK | |
from __future__ import division | |
import numpy as np |
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
# 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/ |
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
# Alec Radford, Indico, Kyle Kastner | |
# License: MIT | |
""" | |
Convolutional VAE in a single file. | |
Bringing in code from IndicoDataSolutions and Alec Radford (NewMu) | |
Additionally converted to use default conv2d interface instead of explicit cuDNN | |
""" | |
import theano | |
import theano.tensor as T | |
from theano.compat.python2x import OrderedDict |
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
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
# author: Kyle Kastner | |
# References: | |
# needleman wunsch (could use other alignment algorithms instead) | |
# https://colab.research.google.com/github/zaneveld/full_spectrum_bioinformatics/blob/master/content/08_phylogenetic_trees/needleman_wunsch_alignment.ipynb |
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
# Author: Kyle Kastner | |
# License: BSD 3-clause | |
# Thanks to Jose (@sotelo) for tons of guidance and debug help | |
# Credit also to Junyoung (@jych) and Shawn (@shawntan) for help/utility funcs | |
# Strangeness in init could be from onehots, via @igul222. Ty init for one hot layer as N(0, 1) just as in embedding | |
# since oh.dot(w) is basically an embedding | |
import os | |
import re | |
import tarfile | |
from collections import Counter |
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
#!/usr/bin/env python | |
import math | |
import matplotlib.pyplot as plt | |
import torch | |
import torch.nn as nn | |
from sklearn.datasets import make_moons | |
from torch import Tensor | |
from tqdm import tqdm |
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
# Author: Kyle Kastner | |
# License: BSD 3-clause | |
# THEANO_FLAGS="optimizer=None,compute_test_value=raise" python tanh_rnn.py | |
import numpy as np | |
import theano | |
import theano.tensor as T | |
from scipy import linalg | |
class sgd(object): |
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
# Based on example here https://trac.ffmpeg.org/wiki/Encode/YouTube | |
text=$(basename $1 .wav) | |
ffmpeg -i $1 -filter_complex \ | |
"[0:a]avectorscope=s=640x518,pad=1280:720[vs]; \ | |
[0:a]showspectrum=mode=separate:color=intensity:scale=cbrt:s=640x518[ss]; \ | |
[0:a]showwaves=s=1280x202:mode=line[sw]; \ | |
[vs][ss]overlay=w[bg]; \ | |
[bg][sw]overlay=0:H-h,drawtext=fontfile=/usr/share/fonts/truetype/fonts-japanese-gothic.ttf:fontcolor=white:x=10:y=10:text=$text[out]" \ | |
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy $text.mkv |
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
# 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 |
NewerOlder