Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Kastner kastnerkyle

View GitHub Profile
View batch_ar_example.py
import numpy as np
# make a minibatch of time, batch, features
# time length 7
# batch size 2
# feature dimension 4:
# 1:4, 10:14, 20:24, 30:34, etc for first minibatch element
# 5:8, 15:18, etc second minibatch el
n_features = 4
n_timesteps = 7
@kastnerkyle
kastnerkyle / Kiritan singing voice synthesis demo.ipynb
Created May 3, 2020 — forked from r9y9/Kiritan singing voice synthesis demo.ipynb
Neural_network_based_singing_voice_synthesis_demo_using_kiritan_singing_database_(Japanese)
View Kiritan singing voice synthesis demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kastnerkyle
kastnerkyle / make_audiobook.py
Created Apr 26, 2020 — forked from madebyollin/make_audiobook.py
Converts an epub or text file to audiobook via Google Cloud TTS
View make_audiobook.py
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys
@kastnerkyle
kastnerkyle / make_audiobook.py
Created Apr 26, 2020 — forked from madebyollin/make_audiobook.py
Converts an epub or text file to audiobook via Google Cloud TTS
View make_audiobook.py
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys
@kastnerkyle
kastnerkyle / newsci-headlines
Created Mar 27, 2020 — forked from gamesbyangelina/newsci-headlines
New Scientist Headlines (Mar 13 - Sept 19)
View newsci-headlines
Some planets may orbit a supermassive black hole instead of a star
This is almost certainly not what Denisovans looked like
UN climate summit: Scientists' messages to world leaders
A hat that zaps the scalp with electricity helps reverse male balding
Man sees the world in miniature after a stroke damages his brain
Do dads matter? Anna Machin on the fascinating science of fatherhood
People like the idea of a carbon tax - if the money is put to good use
Climate change will boost risk of extreme flooding in northern Europe
Fast swimming fish robot could perform underwater surveillance
Ad Astra: Pirates and space monkeys can't save dull space psychodrama
@kastnerkyle
kastnerkyle / pytorch-glumpy.md
Created Mar 4, 2020 — forked from victor-shepardson/pytorch-glumpy.md
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
@kastnerkyle
kastnerkyle / exact_pg.py
Created Jul 17, 2019 — forked from pierrelux/exact_pg.py
Exact Policy Gradient in jax, demonstrated in figure 2d of Dadashi et al. (2019)
View exact_pg.py
import jax
import jax.numpy as np
from jax import grad, jit
from jax.scipy.special import logsumexp
def dadashi_fig2d():
""" Figure 2 d) of
''The Value Function Polytope in Reinforcement Learning''
by Dadashi et al. (2019) https://arxiv.org/abs/1901.11524
View grover_large.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kastnerkyle
kastnerkyle / vloss_single_mcts.py
Last active Jul 18, 2019
vloss MCTS for single player
View vloss_single_mcts.py
# Author: Kyle Kastner
# License: BSD 3-Clause
# based on minigo implementation
# https://github.com/tensorflow/minigo/blob/master/mcts.py
# Useful discussion of the benefits
# http://www.moderndescartes.com/essays/agz/
# single player tweaks based on
# https://tmoer.github.io/AlphaZero/
@kastnerkyle
kastnerkyle / vloss_mcts.py
Last active Jul 18, 2019
MCTS with virtual loss parallelization for leaf selection (important for minibatch move and value estimates)
View vloss_mcts.py
# Author: Kyle Kastner
# License: BSD 3-Clause
# based on minigo implementation
# https://github.com/tensorflow/minigo/blob/master/mcts.py
# Useful discussion of the benefits
# http://www.moderndescartes.com/essays/agz/
# See survey
# http://mcts.ai/pubs/mcts-survey-master.pdf
You can’t perform that action at this time.