This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pytorch implementation of LSHHash from https://github.com/kayzhu/LSHash | |
# Homework: Try to implement LSHHash in pytorch to speed up meanshift. | |
# Motivation: i.e. why calculate all distances when you need only a few. | |
import numpy as np | |
import importlib | |
import torch_utils | |
importlib.reload(torch_utils) | |
from torch_utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %matplotlib inline | |
import pandas as pd | |
import numpy as np | |
import keras | |
import tensorflow as tf | |
import os | |
from keras.models import Model | |
from keras.layers import Input, Embedding, merge | |
from keras.layers.core import Flatten, Dense, Dropout, Lambda |