Skip to content

Instantly share code, notes, and snippets.

View JT5D's full-sized avatar
💭
Multiversing...

JT5D JT5D

💭
Multiversing...
View GitHub Profile
@JT5D
JT5D / umap_sparse.py
Created March 30, 2021 09:43 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@JT5D
JT5D / circle_detection.py
Created February 9, 2017 04:41 — forked from martinsik/circle_detection.py
Circle detection with OpenCV 3.0
import cv2
import time
import math
import numpy as np
capture = cv2.VideoCapture(0)
print capture.get(cv2.CAP_PROP_FPS)
t = 100
w = 640.0
@JT5D
JT5D / GDocService.cs
Created September 9, 2016 08:57 — forked from radiatoryang/GDocService.cs
Fetches a public Google Spreadsheet in Unity. (Doesn't work in Webplayer due to the security sandbox.)
// To prepare a Google Spreadsheet for this:
// make sure the spreadsheet has been published to web (FILE >> PUBLISH TO WEB), which is NOT the same as sharing to web
// To use in a different script:
// 1) include "using Google.GData.Client;"
// 2) include "using Google.GData.Spreadsheets;"
// 3) call "GDocService.GetSpreadsheet( string spreadsheetKey );", see DebugTest section for sample usage
using UnityEngine;
using System.Collections;
@JT5D
JT5D / VRUtility.cs
Created September 9, 2016 08:56 — forked from radiatoryang/VRUtility.cs
a script I give to my Unity VR students that demonstrates a few useful "quality of VR" features for their games -- lowering visual quality for higher framerate, and HMD recentering
using UnityEngine;
using System.Collections;
using UnityEngine.VR; // you always need this to use special VR functions
public class VRUtility : MonoBehaviour {
// Use this for initialization
public void Start () {
// set render quality to 50%, sacrificing visual quality for higher FPS
@JT5D
JT5D / Shield_on_off_hello.ino
Created August 16, 2016 06:11 — forked from aurman/Shield_on_off_hello.ino
Arduino On Off Hello
//*****************************************************************************
/// @file
/// @brief
/// Arduino SmartThings Shield LED Example
//*****************************************************************************
#include <SoftwareSerial.h> //TODO need to set due to some weird wire language linker, should we absorb this whole library into smartthings
#include <SmartThings.h>
#define PIN_THING_RX 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@JT5D
JT5D / pg-pong.py
Created July 10, 2016 17:36 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@JT5D
JT5D / index.html
Created July 10, 2016 07:55 — forked from srosenthal/index.html
d3.js matrix visualization
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v2.min.js?2.8.1"></script>
<body>
<script>
var margin = {top: 100, right: 100, bottom: 100, left: 100},
width = 384,
height = 256;
bigram count score
external_links 1823239 11.0846952043
united_states 1201240 9.51993073859
references_external 1073067 4.49092215503
new_york 1041129 4.9935587872
th_century 617252 5.71497454564
did_not 526168 4.30135948012
los_angeles 259057 63.2530378731
new_zealand 257352 5.34529759482
does_not 239292 4.39354755795