Skip to content

Instantly share code, notes, and snippets.

View noisychannel's full-sized avatar

Gaurav Kumar noisychannel

View GitHub Profile
@noisychannel
noisychannel / Makefile
Created January 26, 2017 10:53
TensorFlow INSTALL
install_venv:
# Install a virtual environment
virtualenv tf_cpu
# Activate the virutal environment
source tf_cpu/bin/activate
# Install tensorflow
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl
pip install $TF_BINARY_URL
install_no_venv:
@noisychannel
noisychannel / free-gpu.sh
Last active August 9, 2016 20:10
Get the first free GPU on a machine
#!/usr/bin/env bash
# Number of free GPUs on a machine
export n_gpus=`lspci | grep -i "nvidia" | wc -l`
# Return -1 if there are no GPUs on the machine
if [ $n_gpus -eq 0 ]; then
echo "-1"
exit -1
fi
@noisychannel
noisychannel / crawl_images.sh
Last active February 26, 2016 00:01
Crawl images
#!/usr/bin/env bash
set -e
ROOT=...
MAX_RECURSION_DEPTH=10
crawl_folder() {
local page=$1
local folder_name=$2
@noisychannel
noisychannel / extractMonotonePhrasePairs.py
Last active February 3, 2016 21:25
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()
@noisychannel
noisychannel / new.Makefile
Last active February 24, 2016 16:54
Makefile to install stuff on new machines/clusters
DATADIR=/export/ws15-mt-data/gkumar
ROOT=/home/gkumar/.local
MAX_THREADS=6
BOOST_DL=http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.55.0%2F&ts=1389613041&use_mirror=kent
CMPH_DL=http://downloads.sourceforge.net/project/cmph/cmph/cmph-2.0.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcmph%2F&ts=1456331818&use_mirror=iweb
VIMCONFIG_DL=https://github.com/noisychannel/VIMconfig
all: new vim boost moses
@noisychannel
noisychannel / .theanorc
Last active January 18, 2017 17:38
Theano config
[global]
mode = FAST_RUN
floatX = float32
int_division = floatX
exception_verbosity = high
warn_float64 = warn
on_unused_input = warn
allow_gc = False
compiledir_format=compiledir-%(platform)s-%(processor)s-%(python_version)s-%(python_bitwidth)s-%(hostname)s
linker = cvm
@noisychannel
noisychannel / .dircolors
Created July 4, 2015 09:34
Dircolors config
# Exact Solarized Dark color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This simple theme was simultaneously designed for these terminal color schemes:
# - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
#
#!/usr/bin/env python
import sys
classMap = {}
classFile = open(sys.argv[1])
input = open(sys.argv[2])
output = open(sys.argv[3], 'w+')
@noisychannel
noisychannel / run_tuner_generic.py
Created June 8, 2015 18:41
Generic tuner for an arbitrary decoder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Runs the Z-MERT and PRO tuners.
"""
from __future__ import print_function
import argparse
from collections import namedtuple
import logging
import os
@noisychannel
noisychannel / monitor-process.sh
Last active August 29, 2015 14:19
Monitor a process
#!/usr/bin/env bash
if [ $# -lt 1 ]; then
echo "Please enter the process ID to monitor:"
exit 1;
fi
#TODO: Change email
EMAIL=gaurav.bison@gmail.com