Skip to content

Instantly share code, notes, and snippets.

@rjpower
rjpower / fizzbuzz.ipynb
Last active July 6, 2016 20:47
fizzbuzz w/ maxout dense
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjpower
rjpower / fizzbuzz.ipynb
Created June 28, 2016 18:01
fizzbuzz with one-hot encoding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjpower
rjpower / document-embeddings.ipynb
Created June 20, 2016 23:24
word2vec in keras
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjpower
rjpower / custom.html
Last active June 16, 2016 21:25
jupyter styling
<!-- originally from: https://raw.githubusercontent.com/barbagroup/CFDPython/master/styles/custom.css -->
<link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Alegreya+Sans:100,300,400,500,700,800,900,100italic,300italic,400italic,500italic,700italic,800italic,900italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400' rel='stylesheet' type='text/css'>
<style>
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjpower
rjpower / bow-embedding-keras.py
Created June 2, 2016 22:08
BOW embedding layers for Keras
class BOW(Embedding):
'''
Bag-of-words embedding layer.
The default embedding layer outputs the concatenation of [W_t * one_hot(input)];
this layer simply sums over the resulting output.
'''
def get_output_shape_for(self, input_shape):
return (input_shape[0], self.output_dim)
@rjpower
rjpower / setup-cuda.sh
Last active January 4, 2023 08:14
Install CUDA kernel module and system libraries for Ubuntu
echo 'deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /' > /etc/apt/sources.list.d/cuda.list
echo 'deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64 /' > /etc/apt/sources.list.d/nvidia-ml.list
apt-get update
apt-get install --force-yes -y nvidia-352
apt-get install --force-yes -y cuda-7-5 cuda-command-line-tools-7-5 cuda-core-7-5 cuda-cublas-7-5 cuda-cublas-dev-7-5 cuda-cudart-7-5 cuda-cudart-dev-7-5 cuda-cufft-7-5 cuda-cufft-dev-7-5 cuda-curand-7-5 cuda-curand-dev-7-5 cuda-cusolver-7-5 cuda-cusolver-dev-7-5 cuda-cusparse-7-5 cuda-cusparse-dev-7-5 cuda-documentation-7-5 cuda-driver-dev-7-5 cuda-gdb-src-7-5 cuda-ld-conf-7-5 cuda-license-7-5 cuda-minimal-build-7-5 cuda-misc-headers-7-5 cuda-npp-7-5 cuda-npp-dev-7-5 cuda-nvrtc-7-5 cuda-nvrtc-dev-7-5 cuda-runtime-7-5 cuda-samples-7-5 cuda-toolkit-7-5 cuda-visual-tools-7-5
apt-get install -y build-essential python-dev python-virtualenv python-pip
apt-get install -y libatlas-dev liblapack-dev
ap
@rjpower
rjpower / keras_bow_grid_search.ipynb
Created April 4, 2016 19:05
Grid search over a number of topologies.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.