Skip to content

Instantly share code, notes, and snippets.

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

JT5D JT5D

💭
Multiversing...
View GitHub Profile
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
@JT5D
JT5D / min-char-rnn.py
Created April 22, 2016 04:41 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@JT5D
JT5D / kmz2json-index.js
Created April 9, 2016 04:24 — forked from bmount/kmz2json-index.js
Node.js kmz-to-json stream via ogr2ogr. from substack/shp2json
var spawn = require('child_process').spawn;
var fs = require('fs');
var path = require('path');
var seq = require('seq');
var findit = require('findit');
var BufferedStream = require('morestreams').BufferedStream;
module.exports = function (inStream) {
var id = Math.floor(Math.random() * (1<<30)).toString(16);
var tmpDir = path.join('/tmp', id);
@JT5D
JT5D / TouchCamera.cs
Created April 6, 2016 06:31 — forked from hiko9lock/TouchCamera.cs
[Unity 3D] Testing camera pan,zoom, orbit for iOS. Setting camera target after you have attached this camera script to camera object.
using UnityEngine;
using System.Collections;
public class TouchCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;
float dx= 0.0F;
@JT5D
JT5D / README.md
Created March 28, 2016 09:13 — forked from bsergean/README.md
Anti-aliasing (FXAA) with headless-gl and three.js

Aliased

Anti-aliased

Getting the code

@JT5D
JT5D / npm-upgrade-bleeding.sh
Created March 15, 2016 06:22 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done