Skip to content

Instantly share code, notes, and snippets.

@arendu-zz
arendu-zz / bokeh_utils.py
Created July 29, 2017 05:59 — forked from robintw/bokeh_utils.py
Bokeh Utils
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x',
fig_width=500, fig_height=500, **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
@arendu-zz
arendu-zz / bokeh_utils.py
Created July 29, 2017 05:59 — forked from robintw/bokeh_utils.py
Bokeh Utils
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x',
fig_width=500, fig_height=500, **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
@arendu-zz
arendu-zz / bayes_by_backprop.py
Created May 29, 2017 19:11 — forked from rocknrollnerd/bayes_by_backprop.py
Theano implementation of Bayes-by-Backprop algorithm from "Weight uncertainty in neural networks" paper
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
from theano.sandbox.rng_mrg import MRG_RandomStreams
from lasagne.updates import adam
from lasagne.utils import collect_shared_vars
from sklearn.datasets import fetch_mldata
from sklearn.cross_validation import train_test_split
from sklearn import preprocessing
@arendu-zz
arendu-zz / .theanorc
Created May 4, 2016 21:35 — forked from noisychannel/.theanorc
Theano config
[global]
mode = FAST_RUN
floatX = float32
int_division = floatX
exception_verbosity = high
warn_float64 = raise
allow_gc = False
compiledir_format=compiledir-%(platform)s-%(processor)s-%(python_version)s-%(python_bitwidth)s-%(hostname)s
linker = cvm
openmp = true
@arendu-zz
arendu-zz / extractMonotonePhrasePairs.py
Created February 3, 2016 21:25 — forked from noisychannel/extractMonotonePhrasePairs.py
Extracts monotone phrase pairs from aligned bitext
#!/usr/bin/env python
# NOTE : This script assumes that the aligments are in the src-tgt format
import optparse
import pprint
import sys
import numpy as np
optparser = optparse.OptionParser()
@arendu-zz
arendu-zz / .screenrc
Last active August 29, 2015 14:19 — forked from joaopizani/.screenrc
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/screen co screen
$ curl http://old.evanmeagher.net/files/gnu-screen-vertsplit.patch > gnu-screen-vertsplit.patch
$ cd screen/src
$ patch < ../../gnu-screen-vertsplit.patch
$ ./configure --enable-locale --enable-telnet --enable-colors256 --enable-rxct_osc
$ make
$ sudo make install
# set up flags for Numpy C extentions compiling
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export CC=gcc
export CXX="g++ -arch i386 -arch x86_64"
sudo pip install numpy
# success!
OPENFST_VERSION=1.3.4
PYFST_VERSION=0.2.3
export CXX="clang++ -std=c++11 -stdlib=libstdc++"
cd ~/Downloads
curl -O http://openfst.org/twiki/pub/FST/FstDownload/openfst-$OPENFST_VERSION.tar.gz
tar zxf openfst-$OPENFST_VERSION.tar.gz
pushd openfst-$OPENFST_VERSION