Skip to content

Instantly share code, notes, and snippets.

"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@AdrianLsk
AdrianLsk / frequency_estimator.py
Last active August 29, 2015 14:26 — forked from endolith/frequency_estimator.py
Frequency estimation methods in Python
from __future__ import division
from scikits.audiolab import flacread
from numpy.fft import rfft, irfft
from numpy import argmax, sqrt, mean, diff, log
from matplotlib.mlab import find
from scipy.signal import blackmanharris, fftconvolve
from time import time
import sys
from parabolic import parabolic
@AdrianLsk
AdrianLsk / crbm.py
Created October 14, 2015 06:53 — forked from gwtaylor/crbm.py
Theano CRBM demonstration
""" Theano CRBM implementation.
For details, see:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv
Sample data:
http://www.uoguelph.ca/~gwtaylor/publications/nips2006mhmublv/motion.mat
@author Graham Taylor"""
import numpy
@AdrianLsk
AdrianLsk / roll_ipython_in_aws.md
Created October 31, 2015 15:04 — forked from iamatypeofwalrus/roll_ipython_in_aws.md
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@AdrianLsk
AdrianLsk / demo.py
Created March 1, 2016 13:06 — forked from zed/demo.py
how to define an elementwise function in pycuda
#!/usr/bin/env python
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
from pycuda.elementwise import ElementwiseKernel
# define elementwise `add()` function
add = ElementwiseKernel(
"float *a, float *b, float *c",
"c[i] = a[i] + b[i]",

How to set your Acer C720 Chromebook to boot to Ubuntu by default.

  1. Place your closed laptop on a soft surface, upside down.
  2. Use a sharp knife to cut a hole in the warranty sticker (YES THIS WILL VOID THE WARRANTY).
  3. Remove the 13 screws with a small phillips head screwdriver (PH1 size works well). Be careful, the screws are very small and will strip easily if you use the wrong size screwdriver.
  4. Remove the bottom of the laptop by pulling up on it near the hinges. It takes a bit of pressure to remove, but if you lift it from the back (near the hinges) the same way you would open a laptop screen, the hooks won't break (even though they will make a loud snapping sound).
  5. Remove the BIOS write-protect screw. It is labeled as #7 in this image
  6. With the bottom off, turn over the laptop and open the screen.
  7. Plug the laptop in (it must b
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AdrianLsk
AdrianLsk / gist:7710b1a9532352c0a4597ea63ec0ef22
Created March 10, 2017 13:18 — forked from fabien0102/gist:88dcaa184d801fd5e67a
Import multiple json files into mongoDB
ls -1 *.json | while read jsonfile; do mongoimport -d support -c logs -file $jsonfile --jsonArray -type json; done
@AdrianLsk
AdrianLsk / matplotlib_utils.py
Created May 25, 2018 19:58
Matplotlib utils
"""Inspired by:
https://gist.github.com/jakevdp/91077b0cae40f8f8244a
http://joseph-long.com/writing/colorbars/
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
@AdrianLsk
AdrianLsk / seldon_local_install.sh
Created June 6, 2018 12:49
installing seldon on arch linux
# references:
# https://github.com/kubernetes/minikube/blob/master/docs/drivers.md
# http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
# https://github.com/SeldonIO/seldon-core/blob/master/notebooks/ksonnet_ambassador_minikube.ipynb
# Install and activate Python 3.6 venv
# Install KVM driver
# Ubuntu
# sudo apt install libvirt-bin qemu-kvm
# Arch Linux