This file contains hidden or 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, jsonify, request, send_from_directory | |
import redis, celery, sys, socket, os, json | |
# config | |
port = 6000 # port on which data streams | |
# app | |
app = Flask(__name__, static_url_path='') | |
app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' | |
app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' |
This file contains hidden or 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
*.json |
This file contains hidden or 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 annoy import AnnoyIndex | |
import json | |
import os | |
def build_ann_index(model): | |
'''Build an ANN model and persist to disk for faster vector similarity queries''' | |
words = list(model.wv.vocab.keys()) # list of strings, one per word | |
idx_to_word = {str(idx): i for idx, i in enumerate(words)} # d[word] = word_idx in words | |
dims = model.wv[words[0]].shape[0] # number of dimensions in each input vector |
This file contains hidden or 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
function getWorldCoords(e) { | |
// identify the x,y coords in canavs that got event | |
var rect = canvas.getBoundingClientRect(), | |
x = e.clientX - rect.left, | |
y = e.clientY - rect.top; | |
// convert x,y to clip space in canvas: | |
// canvas coords from top left in clockwise order | |
// (-1,1), (1,1), (-1,-1), (1, -1) | |
var mouse = new THREE.Vector3(); | |
mouse.x = ( (x / canvas.clientWidth ) * 2) - 1; |
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 hidden or 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> | |
<meta charset='UTF-8'> | |
<title>Drawing a Neural Network</title> | |
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/5.9.2/d3.min.js'></script> | |
</head> | |
<body> | |
<script> |

This file contains hidden or 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
<html> | |
<head> | |
<style> | |
html, body { width: 100%; height: 100%; background: #000; } | |
body { margin: 0; overflow: hidden; } | |
canvas { width: 100%; height: 100%; } | |
</style> | |
<meta charset='UTF-8'> | |
</head> | |
<body> |
This file contains hidden or 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
/** | |
* @author Eberhard Graether / http://egraether.com/ | |
* @author Mark Lundin / http://mark-lundin.com | |
* @author Simone Manini / http://daron1337.github.io | |
* @author Luca Antiga / http://lantiga.github.io | |
*/ | |
THREE.TrackballControls = function ( object, domElement ) { | |
var _this = this; |