Skip to content

Instantly share code, notes, and snippets.

View stephenroller's full-sized avatar
🗨️

Stephen Roller stephenroller

🗨️
View GitHub Profile
=======================================================================
Activating fairseq-fp16-20190211
=======================================================================
Running mode=single
------------------------------------------------------------
Conda PREFIX: /private/home/roller/.conda/envs/fairseq-fp16-20190211
Torch version: 1.0.0.dev20190211
CUDA version: 10.0.130
Using a single GPU
Step bs= 8192
@stephenroller
stephenroller / notesonembeddings.md
Last active October 13, 2015 20:57
Notes on Predicting Word Vectors

Notes on Predicting Word Vectors

Past few months, I've been trying several methods of directly predicting a what word belongs in a given syntactic context. For example, if we have:

dog X man with teeth,

then the syntactic context [1] of the X token is:

nsubj(dog)

dobj(man)

Input:
I don't mean to go all language nerd on you, but I just legit adverbed "legit," verbed "adverb," and adjectived "language nerd."
Output:
(ROOT
(S
(S
(NP (PRP I))
(VP
#!/usr/bin/env python2.7
import argparse
import struct
import pickle
import numpy as np
from composes.semantic_space.space import Space
from composes.matrix.dense_matrix import DenseMatrix
FLOAT_SIZE = 4
@stephenroller
stephenroller / madcow.py
Created January 18, 2013 10:59
madcow: A simple tool for parallelizing bash commands across many Longhorn servers.
#!/usr/bin/env python
import os, errno, os.path
import argparse
JOB_TEMPLATE = """
#!/bin/sh
#-----------------------------------------------------------------------------
#$ -V
#$ -cwd
@stephenroller
stephenroller / gist:3340651
Created August 13, 2012 13:19
base vimrc
set nocompatible
set nohls
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set nobackup
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
@stephenroller
stephenroller / dots-and-boxes.py
Created July 23, 2012 14:46
2 Player Dots and Boxes
#!/usr/bin/env python
import curses, sys, re
from time import sleep
from random import randint
OFFSET_X, OFFSET_Y = 2, 1
BOARD_SIZE = 7
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@stephenroller
stephenroller / hangman.py
Created July 19, 2012 13:11
Simple Hangman Implementation
from __future__ import with_statement
# +-----+
# | |
# | O
# | -|-
# | / \
# |
# -----
#
@stephenroller
stephenroller / tictactoe.prolog
Created July 19, 2012 13:06
Prolog Tic-Tac-Toe
%
% TIC-TAC-TOE
%
% a | b | c
% --+---+---
% d | e | f
% --+---+---
% g | h | i
%
@stephenroller
stephenroller / leo.rb
Created February 13, 2012 21:19
dict.leo.org command line interface
#!/usr/bin/ruby
# example usage:
# $ leo büch*
# book das Buch - Pl. die Bücher
# accounts die Bücher
# stock of books der Bücherbestand
# bookshelf - pl. bookshelves das Bücherbord - Pl. die Bücherborde
# shelf pl.: shelves das Bücherbord
# bookshelf - pl. bookshelves das Bücherbrett