Skip to content

Instantly share code, notes, and snippets.

@rajshah4
rajshah4 / Quickdraw_to_MNISTformat.ipynb
Created July 14, 2017 20:28
Quickdraw npy files to MNIST test/train dataset with visualization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shgidi
shgidi / plot_loss+sample.py
Created July 12, 2017 10:30
plots loss in keras, additionally plots segmentation in image
#https://gist.github.com/stared/dfb4dfaf6d9a8501cd1cc8b8cb806d2e
class PlotLosses(keras.callbacks.Callback):
def __init__(self,imgs):
super(PlotLosses, self).__init__()
self.imgs=imgs
def on_train_begin(self, logs={}):
self.i = 0
self.x = []
@hans
hans / average_embeddings.py
Last active March 26, 2018 18:50
Generate embeddings for rare words in a document by averaging the embeddings of associated context words. Find nearest neighbors of these embeddings to evaluate their quality.
from collections import Counter, defaultdict
import itertools
import os
import random
import re
import numpy as np
EMBEDDING_FILE = "/u/nlp/data/depparser/nn/data/embeddings/en-cw.txt"
EMBEDDING_SERIALIZED = "embeddings.npz"