Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# coding: utf-8 | |
### Summary | |
# This notebook presents the Barnes-Hut implementation of t-SNE. t-SNE is used to visualize high-dimensional data in a low dimensional space that attempts preserve the pairwise high-dimensional similarities in a low-dimensional embedding. The Barnes-Hut algorithm, which is used by astrophysicists to perform N-body simulations, allows the calculation of the t-SNE embedding in $O(N log N)$ time instead of $O(N^{2})$. This effectively allows us to learn embeddings of data sets with millions of elements instead of tens of thousands. | |
### Install | |
# To try out out the BH version of t-SNE, do the following: |
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
from flask import Flask | |
from flask_restful import reqparse, abort, Api, Resource | |
from sqlitedict import SqliteDict | |
from flask import jsonify, request | |
import json | |
data = SqliteDict('./data.sqlite', autocommit=True) | |
app = Flask(__name__) | |
api = Api(app) |
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
from aa import config | |
import pandas as pd | |
import numpy as np | |
import os.path | |
import pickle | |
import chainer | |
import chainer.links as L | |
import chainer.functions as F |
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
'housing social issues, affordability, rent', | |
'computer hardware and monitors', | |
'math, language, meditation and education', | |
'cars and entertainment', | |
'bing, google, facebook, search engines', | |
'transportation and military', | |
'technology in the media and society', | |
'finance and bitcoin', | |
'higher education, business and grad schools', | |
'sleep, stimulants, and excercise', |
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
import chainer | |
from chainer import cuda | |
from chainer import training | |
from chainer.training import extensions | |
from chainer.datasets import TupleDataset | |
from chainer.iterators import SerialIterator | |
class Wrapper(object): | |
def __init__(self, model, batchsize=512, n_epochs=100, device=None, |
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
embeddings_mu = nn.Embedding(n_words, n_dim) | |
embeddings_lv = nn.Embedding(n_words, n_dim) | |
... | |
vector_mu = embeddings_mu(c_index) | |
vector_lv = embeddings_lv(c_index) | |
def normal(mu, lv): | |
random = torch.FloatTensor(std.size()).normal_() | |
return mu + random * torch.exp(0.5 * lv) |
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
"dein Scripts----------------------------- | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=/Users/moody/.vim/bundles/repos/github.com/Shougo/dein.vim | |
" Required: | |
if dein#load_state('/Users/moody/.vim/bundles') |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Facebook Login JavaScript Example</title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<script> | |
// This is called with the results from from FB.getLoginStatus(). | |
function statusChangeCallback(response) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> Login to See Leaderboard </title> | |
</head> | |
<body> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ |
OlderNewer